/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include namespace Aws { namespace RAM { namespace Model { /** */ class CreatePermissionRequest : public RAMRequest { public: AWS_RAM_API CreatePermissionRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "CreatePermission"; } AWS_RAM_API Aws::String SerializePayload() const override; /** *

Specifies the name of the customer managed permission. The name must be * unique within the Amazon Web Services Region.

*/ inline const Aws::String& GetName() const{ return m_name; } /** *

Specifies the name of the customer managed permission. The name must be * unique within the Amazon Web Services Region.

*/ inline bool NameHasBeenSet() const { return m_nameHasBeenSet; } /** *

Specifies the name of the customer managed permission. The name must be * unique within the Amazon Web Services Region.

*/ inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; } /** *

Specifies the name of the customer managed permission. The name must be * unique within the Amazon Web Services Region.

*/ inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); } /** *

Specifies the name of the customer managed permission. The name must be * unique within the Amazon Web Services Region.

*/ inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); } /** *

Specifies the name of the customer managed permission. The name must be * unique within the Amazon Web Services Region.

*/ inline CreatePermissionRequest& WithName(const Aws::String& value) { SetName(value); return *this;} /** *

Specifies the name of the customer managed permission. The name must be * unique within the Amazon Web Services Region.

*/ inline CreatePermissionRequest& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;} /** *

Specifies the name of the customer managed permission. The name must be * unique within the Amazon Web Services Region.

*/ inline CreatePermissionRequest& WithName(const char* value) { SetName(value); return *this;} /** *

Specifies the name of the resource type that this customer managed permission * applies to.

The format is * <service-code>:<resource-type> and is not case * sensitive. For example, to specify an Amazon EC2 Subnet, you can use the string * ec2:subnet. To see the list of valid values for this parameter, * query the ListResourceTypes operation.

*/ inline const Aws::String& GetResourceType() const{ return m_resourceType; } /** *

Specifies the name of the resource type that this customer managed permission * applies to.

The format is * <service-code>:<resource-type> and is not case * sensitive. For example, to specify an Amazon EC2 Subnet, you can use the string * ec2:subnet. To see the list of valid values for this parameter, * query the ListResourceTypes operation.

*/ inline bool ResourceTypeHasBeenSet() const { return m_resourceTypeHasBeenSet; } /** *

Specifies the name of the resource type that this customer managed permission * applies to.

The format is * <service-code>:<resource-type> and is not case * sensitive. For example, to specify an Amazon EC2 Subnet, you can use the string * ec2:subnet. To see the list of valid values for this parameter, * query the ListResourceTypes operation.

*/ inline void SetResourceType(const Aws::String& value) { m_resourceTypeHasBeenSet = true; m_resourceType = value; } /** *

Specifies the name of the resource type that this customer managed permission * applies to.

The format is * <service-code>:<resource-type> and is not case * sensitive. For example, to specify an Amazon EC2 Subnet, you can use the string * ec2:subnet. To see the list of valid values for this parameter, * query the ListResourceTypes operation.

*/ inline void SetResourceType(Aws::String&& value) { m_resourceTypeHasBeenSet = true; m_resourceType = std::move(value); } /** *

Specifies the name of the resource type that this customer managed permission * applies to.

The format is * <service-code>:<resource-type> and is not case * sensitive. For example, to specify an Amazon EC2 Subnet, you can use the string * ec2:subnet. To see the list of valid values for this parameter, * query the ListResourceTypes operation.

*/ inline void SetResourceType(const char* value) { m_resourceTypeHasBeenSet = true; m_resourceType.assign(value); } /** *

Specifies the name of the resource type that this customer managed permission * applies to.

The format is * <service-code>:<resource-type> and is not case * sensitive. For example, to specify an Amazon EC2 Subnet, you can use the string * ec2:subnet. To see the list of valid values for this parameter, * query the ListResourceTypes operation.

*/ inline CreatePermissionRequest& WithResourceType(const Aws::String& value) { SetResourceType(value); return *this;} /** *

Specifies the name of the resource type that this customer managed permission * applies to.

The format is * <service-code>:<resource-type> and is not case * sensitive. For example, to specify an Amazon EC2 Subnet, you can use the string * ec2:subnet. To see the list of valid values for this parameter, * query the ListResourceTypes operation.

*/ inline CreatePermissionRequest& WithResourceType(Aws::String&& value) { SetResourceType(std::move(value)); return *this;} /** *

Specifies the name of the resource type that this customer managed permission * applies to.

The format is * <service-code>:<resource-type> and is not case * sensitive. For example, to specify an Amazon EC2 Subnet, you can use the string * ec2:subnet. To see the list of valid values for this parameter, * query the ListResourceTypes operation.

*/ inline CreatePermissionRequest& WithResourceType(const char* value) { SetResourceType(value); return *this;} /** *

A string in JSON format string that contains the following elements of a * resource-based policy:

  • Effect: must be set to * ALLOW.

  • Action: specifies the actions that * are allowed by this customer managed permission. The list must contain only * actions that are supported by the specified resource type. For a list of all * actions supported by each resource type, see Actions, * resources, and condition keys for Amazon Web Services services in the * Identity and Access Management User Guide.

  • * Condition: (optional) specifies conditional parameters that must evaluate * to true when a user attempts an action for that action to be allowed. For more * information about the Condition element, see IAM * policies: Condition element in the Identity and Access Management User * Guide.

This template can't include either the * Resource or Principal elements. Those are both filled * in by RAM when it instantiates the resource-based policy on each resource shared * using this managed permission. The Resource comes from the ARN of * the specific resource that you are sharing. The Principal comes * from the list of identities added to the resource share.

*/ inline const Aws::String& GetPolicyTemplate() const{ return m_policyTemplate; } /** *

A string in JSON format string that contains the following elements of a * resource-based policy:

  • Effect: must be set to * ALLOW.

  • Action: specifies the actions that * are allowed by this customer managed permission. The list must contain only * actions that are supported by the specified resource type. For a list of all * actions supported by each resource type, see Actions, * resources, and condition keys for Amazon Web Services services in the * Identity and Access Management User Guide.

  • * Condition: (optional) specifies conditional parameters that must evaluate * to true when a user attempts an action for that action to be allowed. For more * information about the Condition element, see IAM * policies: Condition element in the Identity and Access Management User * Guide.

This template can't include either the * Resource or Principal elements. Those are both filled * in by RAM when it instantiates the resource-based policy on each resource shared * using this managed permission. The Resource comes from the ARN of * the specific resource that you are sharing. The Principal comes * from the list of identities added to the resource share.

*/ inline bool PolicyTemplateHasBeenSet() const { return m_policyTemplateHasBeenSet; } /** *

A string in JSON format string that contains the following elements of a * resource-based policy:

  • Effect: must be set to * ALLOW.

  • Action: specifies the actions that * are allowed by this customer managed permission. The list must contain only * actions that are supported by the specified resource type. For a list of all * actions supported by each resource type, see Actions, * resources, and condition keys for Amazon Web Services services in the * Identity and Access Management User Guide.

  • * Condition: (optional) specifies conditional parameters that must evaluate * to true when a user attempts an action for that action to be allowed. For more * information about the Condition element, see IAM * policies: Condition element in the Identity and Access Management User * Guide.

This template can't include either the * Resource or Principal elements. Those are both filled * in by RAM when it instantiates the resource-based policy on each resource shared * using this managed permission. The Resource comes from the ARN of * the specific resource that you are sharing. The Principal comes * from the list of identities added to the resource share.

*/ inline void SetPolicyTemplate(const Aws::String& value) { m_policyTemplateHasBeenSet = true; m_policyTemplate = value; } /** *

A string in JSON format string that contains the following elements of a * resource-based policy:

  • Effect: must be set to * ALLOW.

  • Action: specifies the actions that * are allowed by this customer managed permission. The list must contain only * actions that are supported by the specified resource type. For a list of all * actions supported by each resource type, see Actions, * resources, and condition keys for Amazon Web Services services in the * Identity and Access Management User Guide.

  • * Condition: (optional) specifies conditional parameters that must evaluate * to true when a user attempts an action for that action to be allowed. For more * information about the Condition element, see IAM * policies: Condition element in the Identity and Access Management User * Guide.

This template can't include either the * Resource or Principal elements. Those are both filled * in by RAM when it instantiates the resource-based policy on each resource shared * using this managed permission. The Resource comes from the ARN of * the specific resource that you are sharing. The Principal comes * from the list of identities added to the resource share.

*/ inline void SetPolicyTemplate(Aws::String&& value) { m_policyTemplateHasBeenSet = true; m_policyTemplate = std::move(value); } /** *

A string in JSON format string that contains the following elements of a * resource-based policy:

  • Effect: must be set to * ALLOW.

  • Action: specifies the actions that * are allowed by this customer managed permission. The list must contain only * actions that are supported by the specified resource type. For a list of all * actions supported by each resource type, see Actions, * resources, and condition keys for Amazon Web Services services in the * Identity and Access Management User Guide.

  • * Condition: (optional) specifies conditional parameters that must evaluate * to true when a user attempts an action for that action to be allowed. For more * information about the Condition element, see IAM * policies: Condition element in the Identity and Access Management User * Guide.

This template can't include either the * Resource or Principal elements. Those are both filled * in by RAM when it instantiates the resource-based policy on each resource shared * using this managed permission. The Resource comes from the ARN of * the specific resource that you are sharing. The Principal comes * from the list of identities added to the resource share.

*/ inline void SetPolicyTemplate(const char* value) { m_policyTemplateHasBeenSet = true; m_policyTemplate.assign(value); } /** *

A string in JSON format string that contains the following elements of a * resource-based policy:

  • Effect: must be set to * ALLOW.

  • Action: specifies the actions that * are allowed by this customer managed permission. The list must contain only * actions that are supported by the specified resource type. For a list of all * actions supported by each resource type, see Actions, * resources, and condition keys for Amazon Web Services services in the * Identity and Access Management User Guide.

  • * Condition: (optional) specifies conditional parameters that must evaluate * to true when a user attempts an action for that action to be allowed. For more * information about the Condition element, see IAM * policies: Condition element in the Identity and Access Management User * Guide.

This template can't include either the * Resource or Principal elements. Those are both filled * in by RAM when it instantiates the resource-based policy on each resource shared * using this managed permission. The Resource comes from the ARN of * the specific resource that you are sharing. The Principal comes * from the list of identities added to the resource share.

*/ inline CreatePermissionRequest& WithPolicyTemplate(const Aws::String& value) { SetPolicyTemplate(value); return *this;} /** *

A string in JSON format string that contains the following elements of a * resource-based policy:

  • Effect: must be set to * ALLOW.

  • Action: specifies the actions that * are allowed by this customer managed permission. The list must contain only * actions that are supported by the specified resource type. For a list of all * actions supported by each resource type, see Actions, * resources, and condition keys for Amazon Web Services services in the * Identity and Access Management User Guide.

  • * Condition: (optional) specifies conditional parameters that must evaluate * to true when a user attempts an action for that action to be allowed. For more * information about the Condition element, see IAM * policies: Condition element in the Identity and Access Management User * Guide.

This template can't include either the * Resource or Principal elements. Those are both filled * in by RAM when it instantiates the resource-based policy on each resource shared * using this managed permission. The Resource comes from the ARN of * the specific resource that you are sharing. The Principal comes * from the list of identities added to the resource share.

*/ inline CreatePermissionRequest& WithPolicyTemplate(Aws::String&& value) { SetPolicyTemplate(std::move(value)); return *this;} /** *

A string in JSON format string that contains the following elements of a * resource-based policy:

  • Effect: must be set to * ALLOW.

  • Action: specifies the actions that * are allowed by this customer managed permission. The list must contain only * actions that are supported by the specified resource type. For a list of all * actions supported by each resource type, see Actions, * resources, and condition keys for Amazon Web Services services in the * Identity and Access Management User Guide.

  • * Condition: (optional) specifies conditional parameters that must evaluate * to true when a user attempts an action for that action to be allowed. For more * information about the Condition element, see IAM * policies: Condition element in the Identity and Access Management User * Guide.

This template can't include either the * Resource or Principal elements. Those are both filled * in by RAM when it instantiates the resource-based policy on each resource shared * using this managed permission. The Resource comes from the ARN of * the specific resource that you are sharing. The Principal comes * from the list of identities added to the resource share.

*/ inline CreatePermissionRequest& WithPolicyTemplate(const char* value) { SetPolicyTemplate(value); return *this;} /** *

Specifies a unique, case-sensitive identifier that you provide to ensure the * idempotency of the request. This lets you safely retry the request without * accidentally performing the same operation a second time. Passing the same value * to a later call to an operation requires that you also pass the same value for * all other parameters. We recommend that you use a UUID type of * value..

If you don't provide this value, then Amazon Web Services * generates a random one for you.

If you retry the operation with the same * ClientToken, but with different parameters, the retry fails with an * IdempotentParameterMismatch error.

*/ inline const Aws::String& GetClientToken() const{ return m_clientToken; } /** *

Specifies a unique, case-sensitive identifier that you provide to ensure the * idempotency of the request. This lets you safely retry the request without * accidentally performing the same operation a second time. Passing the same value * to a later call to an operation requires that you also pass the same value for * all other parameters. We recommend that you use a UUID type of * value..

If you don't provide this value, then Amazon Web Services * generates a random one for you.

If you retry the operation with the same * ClientToken, but with different parameters, the retry fails with an * IdempotentParameterMismatch error.

*/ inline bool ClientTokenHasBeenSet() const { return m_clientTokenHasBeenSet; } /** *

Specifies a unique, case-sensitive identifier that you provide to ensure the * idempotency of the request. This lets you safely retry the request without * accidentally performing the same operation a second time. Passing the same value * to a later call to an operation requires that you also pass the same value for * all other parameters. We recommend that you use a UUID type of * value..

If you don't provide this value, then Amazon Web Services * generates a random one for you.

If you retry the operation with the same * ClientToken, but with different parameters, the retry fails with an * IdempotentParameterMismatch error.

*/ inline void SetClientToken(const Aws::String& value) { m_clientTokenHasBeenSet = true; m_clientToken = value; } /** *

Specifies a unique, case-sensitive identifier that you provide to ensure the * idempotency of the request. This lets you safely retry the request without * accidentally performing the same operation a second time. Passing the same value * to a later call to an operation requires that you also pass the same value for * all other parameters. We recommend that you use a UUID type of * value..

If you don't provide this value, then Amazon Web Services * generates a random one for you.

If you retry the operation with the same * ClientToken, but with different parameters, the retry fails with an * IdempotentParameterMismatch error.

*/ inline void SetClientToken(Aws::String&& value) { m_clientTokenHasBeenSet = true; m_clientToken = std::move(value); } /** *

Specifies a unique, case-sensitive identifier that you provide to ensure the * idempotency of the request. This lets you safely retry the request without * accidentally performing the same operation a second time. Passing the same value * to a later call to an operation requires that you also pass the same value for * all other parameters. We recommend that you use a UUID type of * value..

If you don't provide this value, then Amazon Web Services * generates a random one for you.

If you retry the operation with the same * ClientToken, but with different parameters, the retry fails with an * IdempotentParameterMismatch error.

*/ inline void SetClientToken(const char* value) { m_clientTokenHasBeenSet = true; m_clientToken.assign(value); } /** *

Specifies a unique, case-sensitive identifier that you provide to ensure the * idempotency of the request. This lets you safely retry the request without * accidentally performing the same operation a second time. Passing the same value * to a later call to an operation requires that you also pass the same value for * all other parameters. We recommend that you use a UUID type of * value..

If you don't provide this value, then Amazon Web Services * generates a random one for you.

If you retry the operation with the same * ClientToken, but with different parameters, the retry fails with an * IdempotentParameterMismatch error.

*/ inline CreatePermissionRequest& WithClientToken(const Aws::String& value) { SetClientToken(value); return *this;} /** *

Specifies a unique, case-sensitive identifier that you provide to ensure the * idempotency of the request. This lets you safely retry the request without * accidentally performing the same operation a second time. Passing the same value * to a later call to an operation requires that you also pass the same value for * all other parameters. We recommend that you use a UUID type of * value..

If you don't provide this value, then Amazon Web Services * generates a random one for you.

If you retry the operation with the same * ClientToken, but with different parameters, the retry fails with an * IdempotentParameterMismatch error.

*/ inline CreatePermissionRequest& WithClientToken(Aws::String&& value) { SetClientToken(std::move(value)); return *this;} /** *

Specifies a unique, case-sensitive identifier that you provide to ensure the * idempotency of the request. This lets you safely retry the request without * accidentally performing the same operation a second time. Passing the same value * to a later call to an operation requires that you also pass the same value for * all other parameters. We recommend that you use a UUID type of * value..

If you don't provide this value, then Amazon Web Services * generates a random one for you.

If you retry the operation with the same * ClientToken, but with different parameters, the retry fails with an * IdempotentParameterMismatch error.

*/ inline CreatePermissionRequest& WithClientToken(const char* value) { SetClientToken(value); return *this;} /** *

Specifies a list of one or more tag key and value pairs to attach to the * permission.

*/ inline const Aws::Vector& GetTags() const{ return m_tags; } /** *

Specifies a list of one or more tag key and value pairs to attach to the * permission.

*/ inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; } /** *

Specifies a list of one or more tag key and value pairs to attach to the * permission.

*/ inline void SetTags(const Aws::Vector& value) { m_tagsHasBeenSet = true; m_tags = value; } /** *

Specifies a list of one or more tag key and value pairs to attach to the * permission.

*/ inline void SetTags(Aws::Vector&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); } /** *

Specifies a list of one or more tag key and value pairs to attach to the * permission.

*/ inline CreatePermissionRequest& WithTags(const Aws::Vector& value) { SetTags(value); return *this;} /** *

Specifies a list of one or more tag key and value pairs to attach to the * permission.

*/ inline CreatePermissionRequest& WithTags(Aws::Vector&& value) { SetTags(std::move(value)); return *this;} /** *

Specifies a list of one or more tag key and value pairs to attach to the * permission.

*/ inline CreatePermissionRequest& AddTags(const Tag& value) { m_tagsHasBeenSet = true; m_tags.push_back(value); return *this; } /** *

Specifies a list of one or more tag key and value pairs to attach to the * permission.

*/ inline CreatePermissionRequest& AddTags(Tag&& value) { m_tagsHasBeenSet = true; m_tags.push_back(std::move(value)); return *this; } private: Aws::String m_name; bool m_nameHasBeenSet = false; Aws::String m_resourceType; bool m_resourceTypeHasBeenSet = false; Aws::String m_policyTemplate; bool m_policyTemplateHasBeenSet = false; Aws::String m_clientToken; bool m_clientTokenHasBeenSet = false; Aws::Vector m_tags; bool m_tagsHasBeenSet = false; }; } // namespace Model } // namespace RAM } // namespace Aws