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

A JSON string which you can use to limit the event bus permissions you are * granting to only accounts that fulfill the condition. Currently, the only * supported condition is membership in a certain Amazon Web Services organization. * The string must contain Type, Key, and * Value fields. The Value field specifies the ID of the * Amazon Web Services organization. Following is an example value for * Condition:

'{"Type" : "StringEquals", "Key": * "aws:PrincipalOrgID", "Value": "o-1234567890"}'

See Also:

* AWS * API Reference

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

Specifies the type of condition. Currently the only supported value is * StringEquals.

*/ inline const Aws::String& GetType() const{ return m_type; } /** *

Specifies the type of condition. Currently the only supported value is * StringEquals.

*/ inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; } /** *

Specifies the type of condition. Currently the only supported value is * StringEquals.

*/ inline void SetType(const Aws::String& value) { m_typeHasBeenSet = true; m_type = value; } /** *

Specifies the type of condition. Currently the only supported value is * StringEquals.

*/ inline void SetType(Aws::String&& value) { m_typeHasBeenSet = true; m_type = std::move(value); } /** *

Specifies the type of condition. Currently the only supported value is * StringEquals.

*/ inline void SetType(const char* value) { m_typeHasBeenSet = true; m_type.assign(value); } /** *

Specifies the type of condition. Currently the only supported value is * StringEquals.

*/ inline Condition& WithType(const Aws::String& value) { SetType(value); return *this;} /** *

Specifies the type of condition. Currently the only supported value is * StringEquals.

*/ inline Condition& WithType(Aws::String&& value) { SetType(std::move(value)); return *this;} /** *

Specifies the type of condition. Currently the only supported value is * StringEquals.

*/ inline Condition& WithType(const char* value) { SetType(value); return *this;} /** *

Specifies the key for the condition. Currently the only supported key is * aws:PrincipalOrgID.

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

Specifies the key for the condition. Currently the only supported key is * aws:PrincipalOrgID.

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

Specifies the key for the condition. Currently the only supported key is * aws:PrincipalOrgID.

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

Specifies the key for the condition. Currently the only supported key is * aws:PrincipalOrgID.

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

Specifies the key for the condition. Currently the only supported key is * aws:PrincipalOrgID.

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

Specifies the key for the condition. Currently the only supported key is * aws:PrincipalOrgID.

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

Specifies the key for the condition. Currently the only supported key is * aws:PrincipalOrgID.

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

Specifies the key for the condition. Currently the only supported key is * aws:PrincipalOrgID.

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

Specifies the value for the key. Currently, this must be the ID of the * organization.

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

Specifies the value for the key. Currently, this must be the ID of the * organization.

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

Specifies the value for the key. Currently, this must be the ID of the * organization.

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

Specifies the value for the key. Currently, this must be the ID of the * organization.

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

Specifies the value for the key. Currently, this must be the ID of the * organization.

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

Specifies the value for the key. Currently, this must be the ID of the * organization.

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

Specifies the value for the key. Currently, this must be the ID of the * organization.

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

Specifies the value for the key. Currently, this must be the ID of the * organization.

*/ inline Condition& WithValue(const char* value) { SetValue(value); return *this;} private: Aws::String m_type; bool m_typeHasBeenSet = false; Aws::String m_key; bool m_keyHasBeenSet = false; Aws::String m_value; bool m_valueHasBeenSet = false; }; } // namespace Model } // namespace CloudWatchEvents } // namespace Aws