/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace AccessAnalyzer { namespace Model { /** *

A single element in a path through the JSON representation of a * policy.

See Also:

AWS * API Reference

*/ class PathElement { public: AWS_ACCESSANALYZER_API PathElement(); AWS_ACCESSANALYZER_API PathElement(Aws::Utils::Json::JsonView jsonValue); AWS_ACCESSANALYZER_API PathElement& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_ACCESSANALYZER_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

Refers to an index in a JSON array.

*/ inline int GetIndex() const{ return m_index; } /** *

Refers to an index in a JSON array.

*/ inline bool IndexHasBeenSet() const { return m_indexHasBeenSet; } /** *

Refers to an index in a JSON array.

*/ inline void SetIndex(int value) { m_indexHasBeenSet = true; m_index = value; } /** *

Refers to an index in a JSON array.

*/ inline PathElement& WithIndex(int value) { SetIndex(value); return *this;} /** *

Refers to a key in a JSON object.

*/ inline const Aws::String& GetKey() const{ return m_key; } /** *

Refers to a key in a JSON object.

*/ inline bool KeyHasBeenSet() const { return m_keyHasBeenSet; } /** *

Refers to a key in a JSON object.

*/ inline void SetKey(const Aws::String& value) { m_keyHasBeenSet = true; m_key = value; } /** *

Refers to a key in a JSON object.

*/ inline void SetKey(Aws::String&& value) { m_keyHasBeenSet = true; m_key = std::move(value); } /** *

Refers to a key in a JSON object.

*/ inline void SetKey(const char* value) { m_keyHasBeenSet = true; m_key.assign(value); } /** *

Refers to a key in a JSON object.

*/ inline PathElement& WithKey(const Aws::String& value) { SetKey(value); return *this;} /** *

Refers to a key in a JSON object.

*/ inline PathElement& WithKey(Aws::String&& value) { SetKey(std::move(value)); return *this;} /** *

Refers to a key in a JSON object.

*/ inline PathElement& WithKey(const char* value) { SetKey(value); return *this;} /** *

Refers to a substring of a literal string in a JSON object.

*/ inline const Substring& GetSubstring() const{ return m_substring; } /** *

Refers to a substring of a literal string in a JSON object.

*/ inline bool SubstringHasBeenSet() const { return m_substringHasBeenSet; } /** *

Refers to a substring of a literal string in a JSON object.

*/ inline void SetSubstring(const Substring& value) { m_substringHasBeenSet = true; m_substring = value; } /** *

Refers to a substring of a literal string in a JSON object.

*/ inline void SetSubstring(Substring&& value) { m_substringHasBeenSet = true; m_substring = std::move(value); } /** *

Refers to a substring of a literal string in a JSON object.

*/ inline PathElement& WithSubstring(const Substring& value) { SetSubstring(value); return *this;} /** *

Refers to a substring of a literal string in a JSON object.

*/ inline PathElement& WithSubstring(Substring&& value) { SetSubstring(std::move(value)); return *this;} /** *

Refers to the value associated with a given key in a JSON object.

*/ inline const Aws::String& GetValue() const{ return m_value; } /** *

Refers to the value associated with a given key in a JSON object.

*/ inline bool ValueHasBeenSet() const { return m_valueHasBeenSet; } /** *

Refers to the value associated with a given key in a JSON object.

*/ inline void SetValue(const Aws::String& value) { m_valueHasBeenSet = true; m_value = value; } /** *

Refers to the value associated with a given key in a JSON object.

*/ inline void SetValue(Aws::String&& value) { m_valueHasBeenSet = true; m_value = std::move(value); } /** *

Refers to the value associated with a given key in a JSON object.

*/ inline void SetValue(const char* value) { m_valueHasBeenSet = true; m_value.assign(value); } /** *

Refers to the value associated with a given key in a JSON object.

*/ inline PathElement& WithValue(const Aws::String& value) { SetValue(value); return *this;} /** *

Refers to the value associated with a given key in a JSON object.

*/ inline PathElement& WithValue(Aws::String&& value) { SetValue(std::move(value)); return *this;} /** *

Refers to the value associated with a given key in a JSON object.

*/ inline PathElement& WithValue(const char* value) { SetValue(value); return *this;} private: int m_index; bool m_indexHasBeenSet = false; Aws::String m_key; bool m_keyHasBeenSet = false; Substring m_substring; bool m_substringHasBeenSet = false; Aws::String m_value; bool m_valueHasBeenSet = false; }; } // namespace Model } // namespace AccessAnalyzer } // namespace Aws