/** * 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 IAM { namespace Model { /** */ class CreatePolicyRequest : public IAMRequest { public: AWS_IAM_API CreatePolicyRequest(); // 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 "CreatePolicy"; } AWS_IAM_API Aws::String SerializePayload() const override; protected: AWS_IAM_API void DumpBodyToUrl(Aws::Http::URI& uri ) const override; public: /** *

The friendly name of the policy.

IAM user, group, role, and policy * names must be unique within the account. Names are not distinguished by case. * For example, you cannot create resources named both "MyResource" and * "myresource".

*/ inline const Aws::String& GetPolicyName() const{ return m_policyName; } /** *

The friendly name of the policy.

IAM user, group, role, and policy * names must be unique within the account. Names are not distinguished by case. * For example, you cannot create resources named both "MyResource" and * "myresource".

*/ inline bool PolicyNameHasBeenSet() const { return m_policyNameHasBeenSet; } /** *

The friendly name of the policy.

IAM user, group, role, and policy * names must be unique within the account. Names are not distinguished by case. * For example, you cannot create resources named both "MyResource" and * "myresource".

*/ inline void SetPolicyName(const Aws::String& value) { m_policyNameHasBeenSet = true; m_policyName = value; } /** *

The friendly name of the policy.

IAM user, group, role, and policy * names must be unique within the account. Names are not distinguished by case. * For example, you cannot create resources named both "MyResource" and * "myresource".

*/ inline void SetPolicyName(Aws::String&& value) { m_policyNameHasBeenSet = true; m_policyName = std::move(value); } /** *

The friendly name of the policy.

IAM user, group, role, and policy * names must be unique within the account. Names are not distinguished by case. * For example, you cannot create resources named both "MyResource" and * "myresource".

*/ inline void SetPolicyName(const char* value) { m_policyNameHasBeenSet = true; m_policyName.assign(value); } /** *

The friendly name of the policy.

IAM user, group, role, and policy * names must be unique within the account. Names are not distinguished by case. * For example, you cannot create resources named both "MyResource" and * "myresource".

*/ inline CreatePolicyRequest& WithPolicyName(const Aws::String& value) { SetPolicyName(value); return *this;} /** *

The friendly name of the policy.

IAM user, group, role, and policy * names must be unique within the account. Names are not distinguished by case. * For example, you cannot create resources named both "MyResource" and * "myresource".

*/ inline CreatePolicyRequest& WithPolicyName(Aws::String&& value) { SetPolicyName(std::move(value)); return *this;} /** *

The friendly name of the policy.

IAM user, group, role, and policy * names must be unique within the account. Names are not distinguished by case. * For example, you cannot create resources named both "MyResource" and * "myresource".

*/ inline CreatePolicyRequest& WithPolicyName(const char* value) { SetPolicyName(value); return *this;} /** *

The path for the policy.

For more information about paths, see IAM * identifiers in the IAM User Guide.

This parameter is optional. * If it is not included, it defaults to a slash (/).

This parameter allows * (through its regex pattern) a * string of characters consisting of either a forward slash (/) by itself or a * string that must begin and end with forward slashes. In addition, it can contain * any ASCII character from the ! (\u0021) through the DEL character * (\u007F), including most punctuation characters, digits, and upper * and lowercased letters.

You cannot use an asterisk (*) in the path * name.

*/ inline const Aws::String& GetPath() const{ return m_path; } /** *

The path for the policy.

For more information about paths, see IAM * identifiers in the IAM User Guide.

This parameter is optional. * If it is not included, it defaults to a slash (/).

This parameter allows * (through its regex pattern) a * string of characters consisting of either a forward slash (/) by itself or a * string that must begin and end with forward slashes. In addition, it can contain * any ASCII character from the ! (\u0021) through the DEL character * (\u007F), including most punctuation characters, digits, and upper * and lowercased letters.

You cannot use an asterisk (*) in the path * name.

*/ inline bool PathHasBeenSet() const { return m_pathHasBeenSet; } /** *

The path for the policy.

For more information about paths, see IAM * identifiers in the IAM User Guide.

This parameter is optional. * If it is not included, it defaults to a slash (/).

This parameter allows * (through its regex pattern) a * string of characters consisting of either a forward slash (/) by itself or a * string that must begin and end with forward slashes. In addition, it can contain * any ASCII character from the ! (\u0021) through the DEL character * (\u007F), including most punctuation characters, digits, and upper * and lowercased letters.

You cannot use an asterisk (*) in the path * name.

*/ inline void SetPath(const Aws::String& value) { m_pathHasBeenSet = true; m_path = value; } /** *

The path for the policy.

For more information about paths, see IAM * identifiers in the IAM User Guide.

This parameter is optional. * If it is not included, it defaults to a slash (/).

This parameter allows * (through its regex pattern) a * string of characters consisting of either a forward slash (/) by itself or a * string that must begin and end with forward slashes. In addition, it can contain * any ASCII character from the ! (\u0021) through the DEL character * (\u007F), including most punctuation characters, digits, and upper * and lowercased letters.

You cannot use an asterisk (*) in the path * name.

*/ inline void SetPath(Aws::String&& value) { m_pathHasBeenSet = true; m_path = std::move(value); } /** *

The path for the policy.

For more information about paths, see IAM * identifiers in the IAM User Guide.

This parameter is optional. * If it is not included, it defaults to a slash (/).

This parameter allows * (through its regex pattern) a * string of characters consisting of either a forward slash (/) by itself or a * string that must begin and end with forward slashes. In addition, it can contain * any ASCII character from the ! (\u0021) through the DEL character * (\u007F), including most punctuation characters, digits, and upper * and lowercased letters.

You cannot use an asterisk (*) in the path * name.

*/ inline void SetPath(const char* value) { m_pathHasBeenSet = true; m_path.assign(value); } /** *

The path for the policy.

For more information about paths, see IAM * identifiers in the IAM User Guide.

This parameter is optional. * If it is not included, it defaults to a slash (/).

This parameter allows * (through its regex pattern) a * string of characters consisting of either a forward slash (/) by itself or a * string that must begin and end with forward slashes. In addition, it can contain * any ASCII character from the ! (\u0021) through the DEL character * (\u007F), including most punctuation characters, digits, and upper * and lowercased letters.

You cannot use an asterisk (*) in the path * name.

*/ inline CreatePolicyRequest& WithPath(const Aws::String& value) { SetPath(value); return *this;} /** *

The path for the policy.

For more information about paths, see IAM * identifiers in the IAM User Guide.

This parameter is optional. * If it is not included, it defaults to a slash (/).

This parameter allows * (through its regex pattern) a * string of characters consisting of either a forward slash (/) by itself or a * string that must begin and end with forward slashes. In addition, it can contain * any ASCII character from the ! (\u0021) through the DEL character * (\u007F), including most punctuation characters, digits, and upper * and lowercased letters.

You cannot use an asterisk (*) in the path * name.

*/ inline CreatePolicyRequest& WithPath(Aws::String&& value) { SetPath(std::move(value)); return *this;} /** *

The path for the policy.

For more information about paths, see IAM * identifiers in the IAM User Guide.

This parameter is optional. * If it is not included, it defaults to a slash (/).

This parameter allows * (through its regex pattern) a * string of characters consisting of either a forward slash (/) by itself or a * string that must begin and end with forward slashes. In addition, it can contain * any ASCII character from the ! (\u0021) through the DEL character * (\u007F), including most punctuation characters, digits, and upper * and lowercased letters.

You cannot use an asterisk (*) in the path * name.

*/ inline CreatePolicyRequest& WithPath(const char* value) { SetPath(value); return *this;} /** *

The JSON policy document that you want to use as the content for the new * policy.

You must provide policies in JSON format in IAM. However, for * CloudFormation templates formatted in YAML, you can provide the policy in JSON * or YAML format. CloudFormation always converts a YAML policy to JSON format * before submitting it to IAM.

The maximum length of the policy document * that you can pass in this operation, including whitespace, is listed below. To * view the maximum character counts of a managed policy with no whitespaces, see * IAM * and STS character quotas.

To learn more about JSON policy grammar, * see Grammar * of the IAM JSON policy language in the IAM User Guide.

The regex pattern used to validate this * parameter is a string of characters consisting of the following:

  • *

    Any printable ASCII character ranging from the space character * (\u0020) through the end of the ASCII character range

  • *
  • The printable characters in the Basic Latin and Latin-1 Supplement * character set (through \u00FF)

  • The special * characters tab (\u0009), line feed (\u000A), and * carriage return (\u000D)

*/ inline const Aws::String& GetPolicyDocument() const{ return m_policyDocument; } /** *

The JSON policy document that you want to use as the content for the new * policy.

You must provide policies in JSON format in IAM. However, for * CloudFormation templates formatted in YAML, you can provide the policy in JSON * or YAML format. CloudFormation always converts a YAML policy to JSON format * before submitting it to IAM.

The maximum length of the policy document * that you can pass in this operation, including whitespace, is listed below. To * view the maximum character counts of a managed policy with no whitespaces, see * IAM * and STS character quotas.

To learn more about JSON policy grammar, * see Grammar * of the IAM JSON policy language in the IAM User Guide.

The regex pattern used to validate this * parameter is a string of characters consisting of the following:

  • *

    Any printable ASCII character ranging from the space character * (\u0020) through the end of the ASCII character range

  • *
  • The printable characters in the Basic Latin and Latin-1 Supplement * character set (through \u00FF)

  • The special * characters tab (\u0009), line feed (\u000A), and * carriage return (\u000D)

*/ inline bool PolicyDocumentHasBeenSet() const { return m_policyDocumentHasBeenSet; } /** *

The JSON policy document that you want to use as the content for the new * policy.

You must provide policies in JSON format in IAM. However, for * CloudFormation templates formatted in YAML, you can provide the policy in JSON * or YAML format. CloudFormation always converts a YAML policy to JSON format * before submitting it to IAM.

The maximum length of the policy document * that you can pass in this operation, including whitespace, is listed below. To * view the maximum character counts of a managed policy with no whitespaces, see * IAM * and STS character quotas.

To learn more about JSON policy grammar, * see Grammar * of the IAM JSON policy language in the IAM User Guide.

The regex pattern used to validate this * parameter is a string of characters consisting of the following:

  • *

    Any printable ASCII character ranging from the space character * (\u0020) through the end of the ASCII character range

  • *
  • The printable characters in the Basic Latin and Latin-1 Supplement * character set (through \u00FF)

  • The special * characters tab (\u0009), line feed (\u000A), and * carriage return (\u000D)

*/ inline void SetPolicyDocument(const Aws::String& value) { m_policyDocumentHasBeenSet = true; m_policyDocument = value; } /** *

The JSON policy document that you want to use as the content for the new * policy.

You must provide policies in JSON format in IAM. However, for * CloudFormation templates formatted in YAML, you can provide the policy in JSON * or YAML format. CloudFormation always converts a YAML policy to JSON format * before submitting it to IAM.

The maximum length of the policy document * that you can pass in this operation, including whitespace, is listed below. To * view the maximum character counts of a managed policy with no whitespaces, see * IAM * and STS character quotas.

To learn more about JSON policy grammar, * see Grammar * of the IAM JSON policy language in the IAM User Guide.

The regex pattern used to validate this * parameter is a string of characters consisting of the following:

  • *

    Any printable ASCII character ranging from the space character * (\u0020) through the end of the ASCII character range

  • *
  • The printable characters in the Basic Latin and Latin-1 Supplement * character set (through \u00FF)

  • The special * characters tab (\u0009), line feed (\u000A), and * carriage return (\u000D)

*/ inline void SetPolicyDocument(Aws::String&& value) { m_policyDocumentHasBeenSet = true; m_policyDocument = std::move(value); } /** *

The JSON policy document that you want to use as the content for the new * policy.

You must provide policies in JSON format in IAM. However, for * CloudFormation templates formatted in YAML, you can provide the policy in JSON * or YAML format. CloudFormation always converts a YAML policy to JSON format * before submitting it to IAM.

The maximum length of the policy document * that you can pass in this operation, including whitespace, is listed below. To * view the maximum character counts of a managed policy with no whitespaces, see * IAM * and STS character quotas.

To learn more about JSON policy grammar, * see Grammar * of the IAM JSON policy language in the IAM User Guide.

The regex pattern used to validate this * parameter is a string of characters consisting of the following:

  • *

    Any printable ASCII character ranging from the space character * (\u0020) through the end of the ASCII character range

  • *
  • The printable characters in the Basic Latin and Latin-1 Supplement * character set (through \u00FF)

  • The special * characters tab (\u0009), line feed (\u000A), and * carriage return (\u000D)

*/ inline void SetPolicyDocument(const char* value) { m_policyDocumentHasBeenSet = true; m_policyDocument.assign(value); } /** *

The JSON policy document that you want to use as the content for the new * policy.

You must provide policies in JSON format in IAM. However, for * CloudFormation templates formatted in YAML, you can provide the policy in JSON * or YAML format. CloudFormation always converts a YAML policy to JSON format * before submitting it to IAM.

The maximum length of the policy document * that you can pass in this operation, including whitespace, is listed below. To * view the maximum character counts of a managed policy with no whitespaces, see * IAM * and STS character quotas.

To learn more about JSON policy grammar, * see Grammar * of the IAM JSON policy language in the IAM User Guide.

The regex pattern used to validate this * parameter is a string of characters consisting of the following:

  • *

    Any printable ASCII character ranging from the space character * (\u0020) through the end of the ASCII character range

  • *
  • The printable characters in the Basic Latin and Latin-1 Supplement * character set (through \u00FF)

  • The special * characters tab (\u0009), line feed (\u000A), and * carriage return (\u000D)

*/ inline CreatePolicyRequest& WithPolicyDocument(const Aws::String& value) { SetPolicyDocument(value); return *this;} /** *

The JSON policy document that you want to use as the content for the new * policy.

You must provide policies in JSON format in IAM. However, for * CloudFormation templates formatted in YAML, you can provide the policy in JSON * or YAML format. CloudFormation always converts a YAML policy to JSON format * before submitting it to IAM.

The maximum length of the policy document * that you can pass in this operation, including whitespace, is listed below. To * view the maximum character counts of a managed policy with no whitespaces, see * IAM * and STS character quotas.

To learn more about JSON policy grammar, * see Grammar * of the IAM JSON policy language in the IAM User Guide.

The regex pattern used to validate this * parameter is a string of characters consisting of the following:

  • *

    Any printable ASCII character ranging from the space character * (\u0020) through the end of the ASCII character range

  • *
  • The printable characters in the Basic Latin and Latin-1 Supplement * character set (through \u00FF)

  • The special * characters tab (\u0009), line feed (\u000A), and * carriage return (\u000D)

*/ inline CreatePolicyRequest& WithPolicyDocument(Aws::String&& value) { SetPolicyDocument(std::move(value)); return *this;} /** *

The JSON policy document that you want to use as the content for the new * policy.

You must provide policies in JSON format in IAM. However, for * CloudFormation templates formatted in YAML, you can provide the policy in JSON * or YAML format. CloudFormation always converts a YAML policy to JSON format * before submitting it to IAM.

The maximum length of the policy document * that you can pass in this operation, including whitespace, is listed below. To * view the maximum character counts of a managed policy with no whitespaces, see * IAM * and STS character quotas.

To learn more about JSON policy grammar, * see Grammar * of the IAM JSON policy language in the IAM User Guide.

The regex pattern used to validate this * parameter is a string of characters consisting of the following:

  • *

    Any printable ASCII character ranging from the space character * (\u0020) through the end of the ASCII character range

  • *
  • The printable characters in the Basic Latin and Latin-1 Supplement * character set (through \u00FF)

  • The special * characters tab (\u0009), line feed (\u000A), and * carriage return (\u000D)

*/ inline CreatePolicyRequest& WithPolicyDocument(const char* value) { SetPolicyDocument(value); return *this;} /** *

A friendly description of the policy.

Typically used to store * information about the permissions defined in the policy. For example, "Grants * access to production DynamoDB tables."

The policy description is * immutable. After a value is assigned, it cannot be changed.

*/ inline const Aws::String& GetDescription() const{ return m_description; } /** *

A friendly description of the policy.

Typically used to store * information about the permissions defined in the policy. For example, "Grants * access to production DynamoDB tables."

The policy description is * immutable. After a value is assigned, it cannot be changed.

*/ inline bool DescriptionHasBeenSet() const { return m_descriptionHasBeenSet; } /** *

A friendly description of the policy.

Typically used to store * information about the permissions defined in the policy. For example, "Grants * access to production DynamoDB tables."

The policy description is * immutable. After a value is assigned, it cannot be changed.

*/ inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; } /** *

A friendly description of the policy.

Typically used to store * information about the permissions defined in the policy. For example, "Grants * access to production DynamoDB tables."

The policy description is * immutable. After a value is assigned, it cannot be changed.

*/ inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = std::move(value); } /** *

A friendly description of the policy.

Typically used to store * information about the permissions defined in the policy. For example, "Grants * access to production DynamoDB tables."

The policy description is * immutable. After a value is assigned, it cannot be changed.

*/ inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); } /** *

A friendly description of the policy.

Typically used to store * information about the permissions defined in the policy. For example, "Grants * access to production DynamoDB tables."

The policy description is * immutable. After a value is assigned, it cannot be changed.

*/ inline CreatePolicyRequest& WithDescription(const Aws::String& value) { SetDescription(value); return *this;} /** *

A friendly description of the policy.

Typically used to store * information about the permissions defined in the policy. For example, "Grants * access to production DynamoDB tables."

The policy description is * immutable. After a value is assigned, it cannot be changed.

*/ inline CreatePolicyRequest& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;} /** *

A friendly description of the policy.

Typically used to store * information about the permissions defined in the policy. For example, "Grants * access to production DynamoDB tables."

The policy description is * immutable. After a value is assigned, it cannot be changed.

*/ inline CreatePolicyRequest& WithDescription(const char* value) { SetDescription(value); return *this;} /** *

A list of tags that you want to attach to the new IAM customer managed * policy. Each tag consists of a key name and an associated value. For more * information about tagging, see Tagging IAM * resources in the IAM User Guide.

If any one of the tags * is invalid or if you exceed the allowed maximum number of tags, then the entire * request fails and the resource is not created.

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

A list of tags that you want to attach to the new IAM customer managed * policy. Each tag consists of a key name and an associated value. For more * information about tagging, see Tagging IAM * resources in the IAM User Guide.

If any one of the tags * is invalid or if you exceed the allowed maximum number of tags, then the entire * request fails and the resource is not created.

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

A list of tags that you want to attach to the new IAM customer managed * policy. Each tag consists of a key name and an associated value. For more * information about tagging, see Tagging IAM * resources in the IAM User Guide.

If any one of the tags * is invalid or if you exceed the allowed maximum number of tags, then the entire * request fails and the resource is not created.

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

A list of tags that you want to attach to the new IAM customer managed * policy. Each tag consists of a key name and an associated value. For more * information about tagging, see Tagging IAM * resources in the IAM User Guide.

If any one of the tags * is invalid or if you exceed the allowed maximum number of tags, then the entire * request fails and the resource is not created.

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

A list of tags that you want to attach to the new IAM customer managed * policy. Each tag consists of a key name and an associated value. For more * information about tagging, see Tagging IAM * resources in the IAM User Guide.

If any one of the tags * is invalid or if you exceed the allowed maximum number of tags, then the entire * request fails and the resource is not created.

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

A list of tags that you want to attach to the new IAM customer managed * policy. Each tag consists of a key name and an associated value. For more * information about tagging, see Tagging IAM * resources in the IAM User Guide.

If any one of the tags * is invalid or if you exceed the allowed maximum number of tags, then the entire * request fails and the resource is not created.

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

A list of tags that you want to attach to the new IAM customer managed * policy. Each tag consists of a key name and an associated value. For more * information about tagging, see Tagging IAM * resources in the IAM User Guide.

If any one of the tags * is invalid or if you exceed the allowed maximum number of tags, then the entire * request fails and the resource is not created.

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

A list of tags that you want to attach to the new IAM customer managed * policy. Each tag consists of a key name and an associated value. For more * information about tagging, see Tagging IAM * resources in the IAM User Guide.

If any one of the tags * is invalid or if you exceed the allowed maximum number of tags, then the entire * request fails and the resource is not created.

*/ inline CreatePolicyRequest& AddTags(Tag&& value) { m_tagsHasBeenSet = true; m_tags.push_back(std::move(value)); return *this; } private: Aws::String m_policyName; bool m_policyNameHasBeenSet = false; Aws::String m_path; bool m_pathHasBeenSet = false; Aws::String m_policyDocument; bool m_policyDocumentHasBeenSet = false; Aws::String m_description; bool m_descriptionHasBeenSet = false; Aws::Vector m_tags; bool m_tagsHasBeenSet = false; }; } // namespace Model } // namespace IAM } // namespace Aws