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

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 CreatePlacementGroupRequest& WithDryRun(bool value) { SetDryRun(value); return *this;} /** *

A name for the placement group. Must be unique within the scope of your * account for the Region.

Constraints: Up to 255 ASCII characters

*/ inline const Aws::String& GetGroupName() const{ return m_groupName; } /** *

A name for the placement group. Must be unique within the scope of your * account for the Region.

Constraints: Up to 255 ASCII characters

*/ inline bool GroupNameHasBeenSet() const { return m_groupNameHasBeenSet; } /** *

A name for the placement group. Must be unique within the scope of your * account for the Region.

Constraints: Up to 255 ASCII characters

*/ inline void SetGroupName(const Aws::String& value) { m_groupNameHasBeenSet = true; m_groupName = value; } /** *

A name for the placement group. Must be unique within the scope of your * account for the Region.

Constraints: Up to 255 ASCII characters

*/ inline void SetGroupName(Aws::String&& value) { m_groupNameHasBeenSet = true; m_groupName = std::move(value); } /** *

A name for the placement group. Must be unique within the scope of your * account for the Region.

Constraints: Up to 255 ASCII characters

*/ inline void SetGroupName(const char* value) { m_groupNameHasBeenSet = true; m_groupName.assign(value); } /** *

A name for the placement group. Must be unique within the scope of your * account for the Region.

Constraints: Up to 255 ASCII characters

*/ inline CreatePlacementGroupRequest& WithGroupName(const Aws::String& value) { SetGroupName(value); return *this;} /** *

A name for the placement group. Must be unique within the scope of your * account for the Region.

Constraints: Up to 255 ASCII characters

*/ inline CreatePlacementGroupRequest& WithGroupName(Aws::String&& value) { SetGroupName(std::move(value)); return *this;} /** *

A name for the placement group. Must be unique within the scope of your * account for the Region.

Constraints: Up to 255 ASCII characters

*/ inline CreatePlacementGroupRequest& WithGroupName(const char* value) { SetGroupName(value); return *this;} /** *

The placement strategy.

*/ inline const PlacementStrategy& GetStrategy() const{ return m_strategy; } /** *

The placement strategy.

*/ inline bool StrategyHasBeenSet() const { return m_strategyHasBeenSet; } /** *

The placement strategy.

*/ inline void SetStrategy(const PlacementStrategy& value) { m_strategyHasBeenSet = true; m_strategy = value; } /** *

The placement strategy.

*/ inline void SetStrategy(PlacementStrategy&& value) { m_strategyHasBeenSet = true; m_strategy = std::move(value); } /** *

The placement strategy.

*/ inline CreatePlacementGroupRequest& WithStrategy(const PlacementStrategy& value) { SetStrategy(value); return *this;} /** *

The placement strategy.

*/ inline CreatePlacementGroupRequest& WithStrategy(PlacementStrategy&& value) { SetStrategy(std::move(value)); return *this;} /** *

The number of partitions. Valid only when Strategy is set to * partition.

*/ inline int GetPartitionCount() const{ return m_partitionCount; } /** *

The number of partitions. Valid only when Strategy is set to * partition.

*/ inline bool PartitionCountHasBeenSet() const { return m_partitionCountHasBeenSet; } /** *

The number of partitions. Valid only when Strategy is set to * partition.

*/ inline void SetPartitionCount(int value) { m_partitionCountHasBeenSet = true; m_partitionCount = value; } /** *

The number of partitions. Valid only when Strategy is set to * partition.

*/ inline CreatePlacementGroupRequest& WithPartitionCount(int value) { SetPartitionCount(value); return *this;} /** *

The tags to apply to the new placement group.

*/ inline const Aws::Vector& GetTagSpecifications() const{ return m_tagSpecifications; } /** *

The tags to apply to the new placement group.

*/ inline bool TagSpecificationsHasBeenSet() const { return m_tagSpecificationsHasBeenSet; } /** *

The tags to apply to the new placement group.

*/ inline void SetTagSpecifications(const Aws::Vector& value) { m_tagSpecificationsHasBeenSet = true; m_tagSpecifications = value; } /** *

The tags to apply to the new placement group.

*/ inline void SetTagSpecifications(Aws::Vector&& value) { m_tagSpecificationsHasBeenSet = true; m_tagSpecifications = std::move(value); } /** *

The tags to apply to the new placement group.

*/ inline CreatePlacementGroupRequest& WithTagSpecifications(const Aws::Vector& value) { SetTagSpecifications(value); return *this;} /** *

The tags to apply to the new placement group.

*/ inline CreatePlacementGroupRequest& WithTagSpecifications(Aws::Vector&& value) { SetTagSpecifications(std::move(value)); return *this;} /** *

The tags to apply to the new placement group.

*/ inline CreatePlacementGroupRequest& AddTagSpecifications(const TagSpecification& value) { m_tagSpecificationsHasBeenSet = true; m_tagSpecifications.push_back(value); return *this; } /** *

The tags to apply to the new placement group.

*/ inline CreatePlacementGroupRequest& AddTagSpecifications(TagSpecification&& value) { m_tagSpecificationsHasBeenSet = true; m_tagSpecifications.push_back(std::move(value)); return *this; } /** *

Determines how placement groups spread instances.

  • Host – * You can use host only with Outpost placement groups.

  • *

    Rack – No usage restrictions.

*/ inline const SpreadLevel& GetSpreadLevel() const{ return m_spreadLevel; } /** *

Determines how placement groups spread instances.

  • Host – * You can use host only with Outpost placement groups.

  • *

    Rack – No usage restrictions.

*/ inline bool SpreadLevelHasBeenSet() const { return m_spreadLevelHasBeenSet; } /** *

Determines how placement groups spread instances.

  • Host – * You can use host only with Outpost placement groups.

  • *

    Rack – No usage restrictions.

*/ inline void SetSpreadLevel(const SpreadLevel& value) { m_spreadLevelHasBeenSet = true; m_spreadLevel = value; } /** *

Determines how placement groups spread instances.

  • Host – * You can use host only with Outpost placement groups.

  • *

    Rack – No usage restrictions.

*/ inline void SetSpreadLevel(SpreadLevel&& value) { m_spreadLevelHasBeenSet = true; m_spreadLevel = std::move(value); } /** *

Determines how placement groups spread instances.

  • Host – * You can use host only with Outpost placement groups.

  • *

    Rack – No usage restrictions.

*/ inline CreatePlacementGroupRequest& WithSpreadLevel(const SpreadLevel& value) { SetSpreadLevel(value); return *this;} /** *

Determines how placement groups spread instances.

  • Host – * You can use host only with Outpost placement groups.

  • *

    Rack – No usage restrictions.

*/ inline CreatePlacementGroupRequest& WithSpreadLevel(SpreadLevel&& value) { SetSpreadLevel(std::move(value)); return *this;} private: bool m_dryRun; bool m_dryRunHasBeenSet = false; Aws::String m_groupName; bool m_groupNameHasBeenSet = false; PlacementStrategy m_strategy; bool m_strategyHasBeenSet = false; int m_partitionCount; bool m_partitionCountHasBeenSet = false; Aws::Vector m_tagSpecifications; bool m_tagSpecificationsHasBeenSet = false; SpreadLevel m_spreadLevel; bool m_spreadLevelHasBeenSet = false; }; } // namespace Model } // namespace EC2 } // namespace Aws