/** * 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 IAM { namespace Model { /** */ class AWS_IAM_API CreatePolicyRequest : public IAMRequest { public: 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::String SerializePayload() const override; protected: 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.

*/ 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.

*/ 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.

*/ 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.

*/ 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.

*/ 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.

*/ 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.

*/ 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.

*/ 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 AWS * CloudFormation templates formatted in YAML, you can provide the policy in JSON * or YAML format. AWS CloudFormation always converts a YAML policy to JSON format * before submitting it to IAM.

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 AWS * CloudFormation templates formatted in YAML, you can provide the policy in JSON * or YAML format. AWS CloudFormation always converts a YAML policy to JSON format * before submitting it to IAM.

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 AWS * CloudFormation templates formatted in YAML, you can provide the policy in JSON * or YAML format. AWS CloudFormation always converts a YAML policy to JSON format * before submitting it to IAM.

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 AWS * CloudFormation templates formatted in YAML, you can provide the policy in JSON * or YAML format. AWS CloudFormation always converts a YAML policy to JSON format * before submitting it to IAM.

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 AWS * CloudFormation templates formatted in YAML, you can provide the policy in JSON * or YAML format. AWS CloudFormation always converts a YAML policy to JSON format * before submitting it to IAM.

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 AWS * CloudFormation templates formatted in YAML, you can provide the policy in JSON * or YAML format. AWS CloudFormation always converts a YAML policy to JSON format * before submitting it to IAM.

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 AWS * CloudFormation templates formatted in YAML, you can provide the policy in JSON * or YAML format. AWS CloudFormation always converts a YAML policy to JSON format * before submitting it to IAM.

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 AWS * CloudFormation templates formatted in YAML, you can provide the policy in JSON * or YAML format. AWS CloudFormation always converts a YAML policy to JSON format * before submitting it to IAM.

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;} private: Aws::String m_policyName; bool m_policyNameHasBeenSet; Aws::String m_path; bool m_pathHasBeenSet; Aws::String m_policyDocument; bool m_policyDocumentHasBeenSet; Aws::String m_description; bool m_descriptionHasBeenSet; }; } // namespace Model } // namespace IAM } // namespace Aws