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

Contains information about a version of a managed policy.

This data * type is used as a response element in the CreatePolicyVersion, * GetPolicyVersion, ListPolicyVersions, and * GetAccountAuthorizationDetails operations.

For more information * about managed policies, refer to Managed * policies and inline policies in the IAM User Guide.

See * Also:

AWS * API Reference

*/ class PolicyVersion { public: AWS_IAM_API PolicyVersion(); AWS_IAM_API PolicyVersion(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_IAM_API PolicyVersion& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_IAM_API void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; AWS_IAM_API void OutputToStream(Aws::OStream& oStream, const char* location) const; /** *

The policy document.

The policy document is returned in the response * to the GetPolicyVersion and GetAccountAuthorizationDetails * operations. It is not returned in the response to the CreatePolicyVersion * or ListPolicyVersions operations.

The policy document returned in * this structure is URL-encoded compliant with RFC 3986. You can use a URL * decoding method to convert the policy back to plain JSON text. For example, if * you use Java, you can use the decode method of the * java.net.URLDecoder utility class in the Java SDK. Other languages * and SDKs provide similar functionality.

*/ inline const Aws::String& GetDocument() const{ return m_document; } /** *

The policy document.

The policy document is returned in the response * to the GetPolicyVersion and GetAccountAuthorizationDetails * operations. It is not returned in the response to the CreatePolicyVersion * or ListPolicyVersions operations.

The policy document returned in * this structure is URL-encoded compliant with RFC 3986. You can use a URL * decoding method to convert the policy back to plain JSON text. For example, if * you use Java, you can use the decode method of the * java.net.URLDecoder utility class in the Java SDK. Other languages * and SDKs provide similar functionality.

*/ inline bool DocumentHasBeenSet() const { return m_documentHasBeenSet; } /** *

The policy document.

The policy document is returned in the response * to the GetPolicyVersion and GetAccountAuthorizationDetails * operations. It is not returned in the response to the CreatePolicyVersion * or ListPolicyVersions operations.

The policy document returned in * this structure is URL-encoded compliant with RFC 3986. You can use a URL * decoding method to convert the policy back to plain JSON text. For example, if * you use Java, you can use the decode method of the * java.net.URLDecoder utility class in the Java SDK. Other languages * and SDKs provide similar functionality.

*/ inline void SetDocument(const Aws::String& value) { m_documentHasBeenSet = true; m_document = value; } /** *

The policy document.

The policy document is returned in the response * to the GetPolicyVersion and GetAccountAuthorizationDetails * operations. It is not returned in the response to the CreatePolicyVersion * or ListPolicyVersions operations.

The policy document returned in * this structure is URL-encoded compliant with RFC 3986. You can use a URL * decoding method to convert the policy back to plain JSON text. For example, if * you use Java, you can use the decode method of the * java.net.URLDecoder utility class in the Java SDK. Other languages * and SDKs provide similar functionality.

*/ inline void SetDocument(Aws::String&& value) { m_documentHasBeenSet = true; m_document = std::move(value); } /** *

The policy document.

The policy document is returned in the response * to the GetPolicyVersion and GetAccountAuthorizationDetails * operations. It is not returned in the response to the CreatePolicyVersion * or ListPolicyVersions operations.

The policy document returned in * this structure is URL-encoded compliant with RFC 3986. You can use a URL * decoding method to convert the policy back to plain JSON text. For example, if * you use Java, you can use the decode method of the * java.net.URLDecoder utility class in the Java SDK. Other languages * and SDKs provide similar functionality.

*/ inline void SetDocument(const char* value) { m_documentHasBeenSet = true; m_document.assign(value); } /** *

The policy document.

The policy document is returned in the response * to the GetPolicyVersion and GetAccountAuthorizationDetails * operations. It is not returned in the response to the CreatePolicyVersion * or ListPolicyVersions operations.

The policy document returned in * this structure is URL-encoded compliant with RFC 3986. You can use a URL * decoding method to convert the policy back to plain JSON text. For example, if * you use Java, you can use the decode method of the * java.net.URLDecoder utility class in the Java SDK. Other languages * and SDKs provide similar functionality.

*/ inline PolicyVersion& WithDocument(const Aws::String& value) { SetDocument(value); return *this;} /** *

The policy document.

The policy document is returned in the response * to the GetPolicyVersion and GetAccountAuthorizationDetails * operations. It is not returned in the response to the CreatePolicyVersion * or ListPolicyVersions operations.

The policy document returned in * this structure is URL-encoded compliant with RFC 3986. You can use a URL * decoding method to convert the policy back to plain JSON text. For example, if * you use Java, you can use the decode method of the * java.net.URLDecoder utility class in the Java SDK. Other languages * and SDKs provide similar functionality.

*/ inline PolicyVersion& WithDocument(Aws::String&& value) { SetDocument(std::move(value)); return *this;} /** *

The policy document.

The policy document is returned in the response * to the GetPolicyVersion and GetAccountAuthorizationDetails * operations. It is not returned in the response to the CreatePolicyVersion * or ListPolicyVersions operations.

The policy document returned in * this structure is URL-encoded compliant with RFC 3986. You can use a URL * decoding method to convert the policy back to plain JSON text. For example, if * you use Java, you can use the decode method of the * java.net.URLDecoder utility class in the Java SDK. Other languages * and SDKs provide similar functionality.

*/ inline PolicyVersion& WithDocument(const char* value) { SetDocument(value); return *this;} /** *

The identifier for the policy version.

Policy version identifiers * always begin with v (always lowercase). When a policy is created, * the first policy version is v1.

*/ inline const Aws::String& GetVersionId() const{ return m_versionId; } /** *

The identifier for the policy version.

Policy version identifiers * always begin with v (always lowercase). When a policy is created, * the first policy version is v1.

*/ inline bool VersionIdHasBeenSet() const { return m_versionIdHasBeenSet; } /** *

The identifier for the policy version.

Policy version identifiers * always begin with v (always lowercase). When a policy is created, * the first policy version is v1.

*/ inline void SetVersionId(const Aws::String& value) { m_versionIdHasBeenSet = true; m_versionId = value; } /** *

The identifier for the policy version.

Policy version identifiers * always begin with v (always lowercase). When a policy is created, * the first policy version is v1.

*/ inline void SetVersionId(Aws::String&& value) { m_versionIdHasBeenSet = true; m_versionId = std::move(value); } /** *

The identifier for the policy version.

Policy version identifiers * always begin with v (always lowercase). When a policy is created, * the first policy version is v1.

*/ inline void SetVersionId(const char* value) { m_versionIdHasBeenSet = true; m_versionId.assign(value); } /** *

The identifier for the policy version.

Policy version identifiers * always begin with v (always lowercase). When a policy is created, * the first policy version is v1.

*/ inline PolicyVersion& WithVersionId(const Aws::String& value) { SetVersionId(value); return *this;} /** *

The identifier for the policy version.

Policy version identifiers * always begin with v (always lowercase). When a policy is created, * the first policy version is v1.

*/ inline PolicyVersion& WithVersionId(Aws::String&& value) { SetVersionId(std::move(value)); return *this;} /** *

The identifier for the policy version.

Policy version identifiers * always begin with v (always lowercase). When a policy is created, * the first policy version is v1.

*/ inline PolicyVersion& WithVersionId(const char* value) { SetVersionId(value); return *this;} /** *

Specifies whether the policy version is set as the policy's default * version.

*/ inline bool GetIsDefaultVersion() const{ return m_isDefaultVersion; } /** *

Specifies whether the policy version is set as the policy's default * version.

*/ inline bool IsDefaultVersionHasBeenSet() const { return m_isDefaultVersionHasBeenSet; } /** *

Specifies whether the policy version is set as the policy's default * version.

*/ inline void SetIsDefaultVersion(bool value) { m_isDefaultVersionHasBeenSet = true; m_isDefaultVersion = value; } /** *

Specifies whether the policy version is set as the policy's default * version.

*/ inline PolicyVersion& WithIsDefaultVersion(bool value) { SetIsDefaultVersion(value); return *this;} /** *

The date and time, in ISO 8601 * date-time format, when the policy version was created.

*/ inline const Aws::Utils::DateTime& GetCreateDate() const{ return m_createDate; } /** *

The date and time, in ISO 8601 * date-time format, when the policy version was created.

*/ inline bool CreateDateHasBeenSet() const { return m_createDateHasBeenSet; } /** *

The date and time, in ISO 8601 * date-time format, when the policy version was created.

*/ inline void SetCreateDate(const Aws::Utils::DateTime& value) { m_createDateHasBeenSet = true; m_createDate = value; } /** *

The date and time, in ISO 8601 * date-time format, when the policy version was created.

*/ inline void SetCreateDate(Aws::Utils::DateTime&& value) { m_createDateHasBeenSet = true; m_createDate = std::move(value); } /** *

The date and time, in ISO 8601 * date-time format, when the policy version was created.

*/ inline PolicyVersion& WithCreateDate(const Aws::Utils::DateTime& value) { SetCreateDate(value); return *this;} /** *

The date and time, in ISO 8601 * date-time format, when the policy version was created.

*/ inline PolicyVersion& WithCreateDate(Aws::Utils::DateTime&& value) { SetCreateDate(std::move(value)); return *this;} private: Aws::String m_document; bool m_documentHasBeenSet = false; Aws::String m_versionId; bool m_versionIdHasBeenSet = false; bool m_isDefaultVersion; bool m_isDefaultVersionHasBeenSet = false; Aws::Utils::DateTime m_createDate; bool m_createDateHasBeenSet = false; }; } // namespace Model } // namespace IAM } // namespace Aws