/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include #include #include namespace Aws { namespace EC2 { namespace Model { /** *

Contains the parameters for ModifyImageAttribute.

See Also:

* AWS * API Reference

*/ class AWS_EC2_API ModifyImageAttributeRequest : public EC2Request { public: ModifyImageAttributeRequest(); // 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 "ModifyImageAttribute"; } Aws::String SerializePayload() const override; protected: void DumpBodyToUrl(Aws::Http::URI& uri ) const override; public: /** *

The name of the attribute to modify. The valid values are * description, launchPermission, and * productCodes.

*/ inline const Aws::String& GetAttribute() const{ return m_attribute; } /** *

The name of the attribute to modify. The valid values are * description, launchPermission, and * productCodes.

*/ inline bool AttributeHasBeenSet() const { return m_attributeHasBeenSet; } /** *

The name of the attribute to modify. The valid values are * description, launchPermission, and * productCodes.

*/ inline void SetAttribute(const Aws::String& value) { m_attributeHasBeenSet = true; m_attribute = value; } /** *

The name of the attribute to modify. The valid values are * description, launchPermission, and * productCodes.

*/ inline void SetAttribute(Aws::String&& value) { m_attributeHasBeenSet = true; m_attribute = std::move(value); } /** *

The name of the attribute to modify. The valid values are * description, launchPermission, and * productCodes.

*/ inline void SetAttribute(const char* value) { m_attributeHasBeenSet = true; m_attribute.assign(value); } /** *

The name of the attribute to modify. The valid values are * description, launchPermission, and * productCodes.

*/ inline ModifyImageAttributeRequest& WithAttribute(const Aws::String& value) { SetAttribute(value); return *this;} /** *

The name of the attribute to modify. The valid values are * description, launchPermission, and * productCodes.

*/ inline ModifyImageAttributeRequest& WithAttribute(Aws::String&& value) { SetAttribute(std::move(value)); return *this;} /** *

The name of the attribute to modify. The valid values are * description, launchPermission, and * productCodes.

*/ inline ModifyImageAttributeRequest& WithAttribute(const char* value) { SetAttribute(value); return *this;} /** *

A new description for the AMI.

*/ inline const AttributeValue& GetDescription() const{ return m_description; } /** *

A new description for the AMI.

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

A new description for the AMI.

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

A new description for the AMI.

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

A new description for the AMI.

*/ inline ModifyImageAttributeRequest& WithDescription(const AttributeValue& value) { SetDescription(value); return *this;} /** *

A new description for the AMI.

*/ inline ModifyImageAttributeRequest& WithDescription(AttributeValue&& value) { SetDescription(std::move(value)); return *this;} /** *

The ID of the AMI.

*/ inline const Aws::String& GetImageId() const{ return m_imageId; } /** *

The ID of the AMI.

*/ inline bool ImageIdHasBeenSet() const { return m_imageIdHasBeenSet; } /** *

The ID of the AMI.

*/ inline void SetImageId(const Aws::String& value) { m_imageIdHasBeenSet = true; m_imageId = value; } /** *

The ID of the AMI.

*/ inline void SetImageId(Aws::String&& value) { m_imageIdHasBeenSet = true; m_imageId = std::move(value); } /** *

The ID of the AMI.

*/ inline void SetImageId(const char* value) { m_imageIdHasBeenSet = true; m_imageId.assign(value); } /** *

The ID of the AMI.

*/ inline ModifyImageAttributeRequest& WithImageId(const Aws::String& value) { SetImageId(value); return *this;} /** *

The ID of the AMI.

*/ inline ModifyImageAttributeRequest& WithImageId(Aws::String&& value) { SetImageId(std::move(value)); return *this;} /** *

The ID of the AMI.

*/ inline ModifyImageAttributeRequest& WithImageId(const char* value) { SetImageId(value); return *this;} /** *

A new launch permission for the AMI.

*/ inline const LaunchPermissionModifications& GetLaunchPermission() const{ return m_launchPermission; } /** *

A new launch permission for the AMI.

*/ inline bool LaunchPermissionHasBeenSet() const { return m_launchPermissionHasBeenSet; } /** *

A new launch permission for the AMI.

*/ inline void SetLaunchPermission(const LaunchPermissionModifications& value) { m_launchPermissionHasBeenSet = true; m_launchPermission = value; } /** *

A new launch permission for the AMI.

*/ inline void SetLaunchPermission(LaunchPermissionModifications&& value) { m_launchPermissionHasBeenSet = true; m_launchPermission = std::move(value); } /** *

A new launch permission for the AMI.

*/ inline ModifyImageAttributeRequest& WithLaunchPermission(const LaunchPermissionModifications& value) { SetLaunchPermission(value); return *this;} /** *

A new launch permission for the AMI.

*/ inline ModifyImageAttributeRequest& WithLaunchPermission(LaunchPermissionModifications&& value) { SetLaunchPermission(std::move(value)); return *this;} /** *

The operation type. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline const OperationType& GetOperationType() const{ return m_operationType; } /** *

The operation type. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline bool OperationTypeHasBeenSet() const { return m_operationTypeHasBeenSet; } /** *

The operation type. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline void SetOperationType(const OperationType& value) { m_operationTypeHasBeenSet = true; m_operationType = value; } /** *

The operation type. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline void SetOperationType(OperationType&& value) { m_operationTypeHasBeenSet = true; m_operationType = std::move(value); } /** *

The operation type. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline ModifyImageAttributeRequest& WithOperationType(const OperationType& value) { SetOperationType(value); return *this;} /** *

The operation type. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline ModifyImageAttributeRequest& WithOperationType(OperationType&& value) { SetOperationType(std::move(value)); return *this;} /** *

The DevPay product codes. After you add a product code to an AMI, it can't be * removed.

*/ inline const Aws::Vector& GetProductCodes() const{ return m_productCodes; } /** *

The DevPay product codes. After you add a product code to an AMI, it can't be * removed.

*/ inline bool ProductCodesHasBeenSet() const { return m_productCodesHasBeenSet; } /** *

The DevPay product codes. After you add a product code to an AMI, it can't be * removed.

*/ inline void SetProductCodes(const Aws::Vector& value) { m_productCodesHasBeenSet = true; m_productCodes = value; } /** *

The DevPay product codes. After you add a product code to an AMI, it can't be * removed.

*/ inline void SetProductCodes(Aws::Vector&& value) { m_productCodesHasBeenSet = true; m_productCodes = std::move(value); } /** *

The DevPay product codes. After you add a product code to an AMI, it can't be * removed.

*/ inline ModifyImageAttributeRequest& WithProductCodes(const Aws::Vector& value) { SetProductCodes(value); return *this;} /** *

The DevPay product codes. After you add a product code to an AMI, it can't be * removed.

*/ inline ModifyImageAttributeRequest& WithProductCodes(Aws::Vector&& value) { SetProductCodes(std::move(value)); return *this;} /** *

The DevPay product codes. After you add a product code to an AMI, it can't be * removed.

*/ inline ModifyImageAttributeRequest& AddProductCodes(const Aws::String& value) { m_productCodesHasBeenSet = true; m_productCodes.push_back(value); return *this; } /** *

The DevPay product codes. After you add a product code to an AMI, it can't be * removed.

*/ inline ModifyImageAttributeRequest& AddProductCodes(Aws::String&& value) { m_productCodesHasBeenSet = true; m_productCodes.push_back(std::move(value)); return *this; } /** *

The DevPay product codes. After you add a product code to an AMI, it can't be * removed.

*/ inline ModifyImageAttributeRequest& AddProductCodes(const char* value) { m_productCodesHasBeenSet = true; m_productCodes.push_back(value); return *this; } /** *

The user groups. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline const Aws::Vector& GetUserGroups() const{ return m_userGroups; } /** *

The user groups. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline bool UserGroupsHasBeenSet() const { return m_userGroupsHasBeenSet; } /** *

The user groups. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline void SetUserGroups(const Aws::Vector& value) { m_userGroupsHasBeenSet = true; m_userGroups = value; } /** *

The user groups. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline void SetUserGroups(Aws::Vector&& value) { m_userGroupsHasBeenSet = true; m_userGroups = std::move(value); } /** *

The user groups. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline ModifyImageAttributeRequest& WithUserGroups(const Aws::Vector& value) { SetUserGroups(value); return *this;} /** *

The user groups. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline ModifyImageAttributeRequest& WithUserGroups(Aws::Vector&& value) { SetUserGroups(std::move(value)); return *this;} /** *

The user groups. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline ModifyImageAttributeRequest& AddUserGroups(const Aws::String& value) { m_userGroupsHasBeenSet = true; m_userGroups.push_back(value); return *this; } /** *

The user groups. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline ModifyImageAttributeRequest& AddUserGroups(Aws::String&& value) { m_userGroupsHasBeenSet = true; m_userGroups.push_back(std::move(value)); return *this; } /** *

The user groups. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline ModifyImageAttributeRequest& AddUserGroups(const char* value) { m_userGroupsHasBeenSet = true; m_userGroups.push_back(value); return *this; } /** *

The AWS account IDs. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline const Aws::Vector& GetUserIds() const{ return m_userIds; } /** *

The AWS account IDs. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline bool UserIdsHasBeenSet() const { return m_userIdsHasBeenSet; } /** *

The AWS account IDs. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline void SetUserIds(const Aws::Vector& value) { m_userIdsHasBeenSet = true; m_userIds = value; } /** *

The AWS account IDs. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline void SetUserIds(Aws::Vector&& value) { m_userIdsHasBeenSet = true; m_userIds = std::move(value); } /** *

The AWS account IDs. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline ModifyImageAttributeRequest& WithUserIds(const Aws::Vector& value) { SetUserIds(value); return *this;} /** *

The AWS account IDs. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline ModifyImageAttributeRequest& WithUserIds(Aws::Vector&& value) { SetUserIds(std::move(value)); return *this;} /** *

The AWS account IDs. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline ModifyImageAttributeRequest& AddUserIds(const Aws::String& value) { m_userIdsHasBeenSet = true; m_userIds.push_back(value); return *this; } /** *

The AWS account IDs. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline ModifyImageAttributeRequest& AddUserIds(Aws::String&& value) { m_userIdsHasBeenSet = true; m_userIds.push_back(std::move(value)); return *this; } /** *

The AWS account IDs. This parameter can be used only when the * Attribute parameter is launchPermission.

*/ inline ModifyImageAttributeRequest& AddUserIds(const char* value) { m_userIdsHasBeenSet = true; m_userIds.push_back(value); return *this; } /** *

The value of the attribute being modified. This parameter can be used only * when the Attribute parameter is description or * productCodes.

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

The value of the attribute being modified. This parameter can be used only * when the Attribute parameter is description or * productCodes.

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

The value of the attribute being modified. This parameter can be used only * when the Attribute parameter is description or * productCodes.

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

The value of the attribute being modified. This parameter can be used only * when the Attribute parameter is description or * productCodes.

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

The value of the attribute being modified. This parameter can be used only * when the Attribute parameter is description or * productCodes.

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

The value of the attribute being modified. This parameter can be used only * when the Attribute parameter is description or * productCodes.

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

The value of the attribute being modified. This parameter can be used only * when the Attribute parameter is description or * productCodes.

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

The value of the attribute being modified. This parameter can be used only * when the Attribute parameter is description or * productCodes.

*/ inline ModifyImageAttributeRequest& WithValue(const char* value) { SetValue(value); return *this;} /** *

Checks whether you have the required permissions for the action, without * actually making the request, and provides an error response. If you have the * required permissions, the error response is DryRunOperation. * Otherwise, it is UnauthorizedOperation.

*/ inline bool GetDryRun() const{ return m_dryRun; } /** *

Checks whether you have the required permissions for the action, without * actually making the request, and provides an error response. If you have the * required permissions, the error response is DryRunOperation. * Otherwise, it is UnauthorizedOperation.

*/ inline bool DryRunHasBeenSet() const { return m_dryRunHasBeenSet; } /** *

Checks whether you have the required permissions for the action, without * actually making the request, and provides an error response. If you have the * required permissions, the error response is DryRunOperation. * Otherwise, it is UnauthorizedOperation.

*/ inline void SetDryRun(bool value) { m_dryRunHasBeenSet = true; m_dryRun = value; } /** *

Checks whether you have the required permissions for the action, without * actually making the request, and provides an error response. If you have the * required permissions, the error response is DryRunOperation. * Otherwise, it is UnauthorizedOperation.

*/ inline ModifyImageAttributeRequest& WithDryRun(bool value) { SetDryRun(value); return *this;} private: Aws::String m_attribute; bool m_attributeHasBeenSet; AttributeValue m_description; bool m_descriptionHasBeenSet; Aws::String m_imageId; bool m_imageIdHasBeenSet; LaunchPermissionModifications m_launchPermission; bool m_launchPermissionHasBeenSet; OperationType m_operationType; bool m_operationTypeHasBeenSet; Aws::Vector m_productCodes; bool m_productCodesHasBeenSet; Aws::Vector m_userGroups; bool m_userGroupsHasBeenSet; Aws::Vector m_userIds; bool m_userIdsHasBeenSet; Aws::String m_value; bool m_valueHasBeenSet; bool m_dryRun; bool m_dryRunHasBeenSet; }; } // namespace Model } // namespace EC2 } // namespace Aws