1 1 | // Code generated by smithy-kotlin codegen. DO NOT EDIT!
|
2 2 |
|
3 3 | package aws.sdk.kotlin.services.ec2.model
|
4 4 |
|
5 5 | import aws.smithy.kotlin.runtime.SdkDsl
|
6 6 |
|
7 + | private val awsSdkKotlinServicesEc2ModelHostCpuOptionsRequestDslBuilderRef = aws.sdk.kotlin.services.ec2.model.HostCpuOptionsRequest
|
7 8 |
|
8 9 | public class AllocateHostsRequest private constructor(builder: Builder) {
|
9 10 | /**
|
10 11 | * The IDs of the Outpost hardware assets on which to allocate the Dedicated Hosts. Targeting specific hardware assets on an Outpost can help to minimize latency between your workloads. This parameter is supported only if you specify **OutpostArn**. If you are allocating the Dedicated Hosts in a Region, omit this parameter.
|
11 12 | * + If you specify this parameter, you can omit **Quantity**. In this case, Amazon EC2 allocates a Dedicated Host on each specified hardware asset.
|
12 13 | * + If you specify both **AssetIds** and **Quantity**, then the value for **Quantity** must be equal to the number of asset IDs specified.
|
13 14 | */
|
14 15 | public val assetIds: List<String>? = builder.assetIds
|
15 16 | /**
|
16 17 | * Indicates whether the host accepts any untargeted instance launches that match its instance type configuration, or if it only accepts Host tenancy instance launches that specify its unique host ID. For more information, see [ Understanding auto-placement and affinity](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-understanding) in the *Amazon EC2 User Guide*.
|
17 18 | *
|
18 19 | * Default: `off`
|
19 20 | */
|
20 21 | public val autoPlacement: aws.sdk.kotlin.services.ec2.model.AutoPlacement? = builder.autoPlacement
|
21 22 | /**
|
22 23 | * The Availability Zone in which to allocate the Dedicated Host.
|
23 24 | */
|
24 25 | public val availabilityZone: kotlin.String? = builder.availabilityZone
|
25 26 | /**
|
26 27 | * The ID of the Availability Zone.
|
27 28 | */
|
28 29 | public val availabilityZoneId: kotlin.String? = builder.availabilityZoneId
|
29 30 | /**
|
30 31 | * Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see [Ensuring Idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
|
31 32 | */
|
32 33 | public val clientToken: kotlin.String? = builder.clientToken
|
34 + | /**
|
35 + | * The CPU configuration options to apply to the Dedicated Host.
|
36 + | */
|
37 + | public val cpuOptions: aws.sdk.kotlin.services.ec2.model.HostCpuOptionsRequest? = builder.cpuOptions
|
33 38 | /**
|
34 39 | * Indicates whether to enable or disable host maintenance for the Dedicated Host. For more information, see [Host maintenance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-maintenance.html) in the *Amazon EC2 User Guide*.
|
35 40 | */
|
36 41 | public val hostMaintenance: aws.sdk.kotlin.services.ec2.model.HostMaintenance? = builder.hostMaintenance
|
37 42 | /**
|
38 43 | * Indicates whether to enable or disable host recovery for the Dedicated Host. Host recovery is disabled by default. For more information, see [ Host recovery](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html) in the *Amazon EC2 User Guide*.
|
39 44 | *
|
40 45 | * Default: `off`
|
41 46 | */
|
42 47 | public val hostRecovery: aws.sdk.kotlin.services.ec2.model.HostRecovery? = builder.hostRecovery
|
43 48 | /**
|
44 49 | * Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family.
|
45 50 | *
|
46 51 | * If you want the Dedicated Hosts to support a specific instance type only, omit this parameter and specify **InstanceType** instead. You cannot specify **InstanceFamily** and **InstanceType** in the same request.
|
47 52 | */
|
48 53 | public val instanceFamily: kotlin.String? = builder.instanceFamily
|
49 54 | /**
|
50 55 | * Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only.
|
51 56 | *
|
52 57 | * If you want the Dedicated Hosts to support multiple instance types in a specific instance family, omit this parameter and specify **InstanceFamily** instead. You cannot specify **InstanceType** and **InstanceFamily** in the same request.
|
53 58 | */
|
54 59 | public val instanceType: kotlin.String? = builder.instanceType
|
55 60 | /**
|
56 61 | * The Amazon Resource Name (ARN) of the Amazon Web Services Outpost on which to allocate the Dedicated Host. If you specify **OutpostArn**, you can optionally specify **AssetIds**.
|
57 62 | *
|
58 63 | * If you are allocating the Dedicated Host in a Region, omit this parameter.
|
59 64 | */
|
60 65 | public val outpostArn: kotlin.String? = builder.outpostArn
|
61 66 | /**
|
62 67 | * The number of Dedicated Hosts to allocate to your account with these parameters. If you are allocating the Dedicated Hosts on an Outpost, and you specify **AssetIds**, you can omit this parameter. In this case, Amazon EC2 allocates a Dedicated Host on each specified hardware asset. If you specify both **AssetIds** and **Quantity**, then the value that you specify for **Quantity** must be equal to the number of asset IDs specified.
|
63 68 | */
|
64 69 | public val quantity: kotlin.Int? = builder.quantity
|
65 70 | /**
|
66 71 | * The tags to apply to the Dedicated Host during creation.
|
67 72 | */
|
68 73 | public val tagSpecifications: List<TagSpecification>? = builder.tagSpecifications
|
69 74 |
|
70 75 | public companion object {
|
71 76 | public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.ec2.model.AllocateHostsRequest = Builder().apply(block).build()
|
72 77 | }
|
73 78 |
|
74 79 | override fun toString(): kotlin.String = buildString {
|
75 80 | append("AllocateHostsRequest(")
|
76 81 | append("assetIds=$assetIds,")
|
77 82 | append("autoPlacement=$autoPlacement,")
|
78 83 | append("availabilityZone=$availabilityZone,")
|
79 84 | append("availabilityZoneId=$availabilityZoneId,")
|
80 85 | append("clientToken=$clientToken,")
|
86 + | append("cpuOptions=$cpuOptions,")
|
81 87 | append("hostMaintenance=$hostMaintenance,")
|
82 88 | append("hostRecovery=$hostRecovery,")
|
83 89 | append("instanceFamily=$instanceFamily,")
|
84 90 | append("instanceType=$instanceType,")
|
85 91 | append("outpostArn=$outpostArn,")
|
86 92 | append("quantity=$quantity,")
|
87 93 | append("tagSpecifications=$tagSpecifications")
|
88 94 | append(")")
|
89 95 | }
|
90 96 |
|
91 97 | override fun hashCode(): kotlin.Int {
|
92 98 | var result = assetIds?.hashCode() ?: 0
|
93 99 | result = 31 * result + (this.autoPlacement?.hashCode() ?: 0)
|
94 100 | result = 31 * result + (this.availabilityZone?.hashCode() ?: 0)
|
95 101 | result = 31 * result + (this.availabilityZoneId?.hashCode() ?: 0)
|
96 102 | result = 31 * result + (this.clientToken?.hashCode() ?: 0)
|
103 + | result = 31 * result + (this.cpuOptions?.hashCode() ?: 0)
|
97 104 | result = 31 * result + (this.hostMaintenance?.hashCode() ?: 0)
|
98 105 | result = 31 * result + (this.hostRecovery?.hashCode() ?: 0)
|
99 106 | result = 31 * result + (this.instanceFamily?.hashCode() ?: 0)
|
100 107 | result = 31 * result + (this.instanceType?.hashCode() ?: 0)
|
101 108 | result = 31 * result + (this.outpostArn?.hashCode() ?: 0)
|
102 109 | result = 31 * result + (this.quantity ?: 0)
|
103 110 | result = 31 * result + (this.tagSpecifications?.hashCode() ?: 0)
|
104 111 | return result
|
105 112 | }
|
106 113 |
|
107 114 | override fun equals(other: kotlin.Any?): kotlin.Boolean {
|
108 115 | if (this === other) return true
|
109 116 | if (other == null || this::class != other::class) return false
|
110 117 |
|
111 118 | other as AllocateHostsRequest
|
112 119 |
|
113 120 | if (assetIds != other.assetIds) return false
|
114 121 | if (autoPlacement != other.autoPlacement) return false
|
115 122 | if (availabilityZone != other.availabilityZone) return false
|
116 123 | if (availabilityZoneId != other.availabilityZoneId) return false
|
117 124 | if (clientToken != other.clientToken) return false
|
125 + | if (cpuOptions != other.cpuOptions) return false
|
118 126 | if (hostMaintenance != other.hostMaintenance) return false
|
119 127 | if (hostRecovery != other.hostRecovery) return false
|
120 128 | if (instanceFamily != other.instanceFamily) return false
|
121 129 | if (instanceType != other.instanceType) return false
|
122 130 | if (outpostArn != other.outpostArn) return false
|
123 131 | if (quantity != other.quantity) return false
|
124 132 | if (tagSpecifications != other.tagSpecifications) return false
|
125 133 |
|
126 134 | return true
|
127 135 | }
|
128 136 |
|
129 137 | public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.ec2.model.AllocateHostsRequest = Builder(this).apply(block).build()
|
130 138 |
|
131 139 | @SdkDsl
|
132 140 | public class Builder {
|
133 141 | /**
|
134 142 | * The IDs of the Outpost hardware assets on which to allocate the Dedicated Hosts. Targeting specific hardware assets on an Outpost can help to minimize latency between your workloads. This parameter is supported only if you specify **OutpostArn**. If you are allocating the Dedicated Hosts in a Region, omit this parameter.
|
135 143 | * + If you specify this parameter, you can omit **Quantity**. In this case, Amazon EC2 allocates a Dedicated Host on each specified hardware asset.
|
136 144 | * + If you specify both **AssetIds** and **Quantity**, then the value for **Quantity** must be equal to the number of asset IDs specified.
|
137 145 | */
|
138 146 | public var assetIds: List<String>? = null
|
139 147 | /**
|
140 148 | * Indicates whether the host accepts any untargeted instance launches that match its instance type configuration, or if it only accepts Host tenancy instance launches that specify its unique host ID. For more information, see [ Understanding auto-placement and affinity](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-understanding) in the *Amazon EC2 User Guide*.
|
141 149 | *
|
142 150 | * Default: `off`
|
143 151 | */
|
144 152 | public var autoPlacement: aws.sdk.kotlin.services.ec2.model.AutoPlacement? = null
|
145 153 | /**
|
146 154 | * The Availability Zone in which to allocate the Dedicated Host.
|
147 155 | */
|
148 156 | public var availabilityZone: kotlin.String? = null
|
149 157 | /**
|
150 158 | * The ID of the Availability Zone.
|
151 159 | */
|
152 160 | public var availabilityZoneId: kotlin.String? = null
|
153 161 | /**
|
154 162 | * Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see [Ensuring Idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
|
155 163 | */
|
156 164 | public var clientToken: kotlin.String? = null
|
165 + | /**
|
166 + | * The CPU configuration options to apply to the Dedicated Host.
|
167 + | */
|
168 + | public var cpuOptions: aws.sdk.kotlin.services.ec2.model.HostCpuOptionsRequest? = null
|
157 169 | /**
|
158 170 | * Indicates whether to enable or disable host maintenance for the Dedicated Host. For more information, see [Host maintenance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-maintenance.html) in the *Amazon EC2 User Guide*.
|
159 171 | */
|
160 172 | public var hostMaintenance: aws.sdk.kotlin.services.ec2.model.HostMaintenance? = null
|
161 173 | /**
|
162 174 | * Indicates whether to enable or disable host recovery for the Dedicated Host. Host recovery is disabled by default. For more information, see [ Host recovery](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html) in the *Amazon EC2 User Guide*.
|
163 175 | *
|
164 176 | * Default: `off`
|
165 177 | */
|
166 178 | public var hostRecovery: aws.sdk.kotlin.services.ec2.model.HostRecovery? = null
|
167 179 | /**
|
168 180 | * Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family.
|
169 181 | *
|
170 182 | * If you want the Dedicated Hosts to support a specific instance type only, omit this parameter and specify **InstanceType** instead. You cannot specify **InstanceFamily** and **InstanceType** in the same request.
|
171 183 | */
|
172 184 | public var instanceFamily: kotlin.String? = null
|
173 185 | /**
|
174 186 | * Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only.
|
175 187 | *
|
176 188 | * If you want the Dedicated Hosts to support multiple instance types in a specific instance family, omit this parameter and specify **InstanceFamily** instead. You cannot specify **InstanceType** and **InstanceFamily** in the same request.
|
177 189 | */
|
178 190 | public var instanceType: kotlin.String? = null
|
179 191 | /**
|
180 192 | * The Amazon Resource Name (ARN) of the Amazon Web Services Outpost on which to allocate the Dedicated Host. If you specify **OutpostArn**, you can optionally specify **AssetIds**.
|
181 193 | *
|
182 194 | * If you are allocating the Dedicated Host in a Region, omit this parameter.
|
183 195 | */
|
184 196 | public var outpostArn: kotlin.String? = null
|
185 197 | /**
|
186 198 | * The number of Dedicated Hosts to allocate to your account with these parameters. If you are allocating the Dedicated Hosts on an Outpost, and you specify **AssetIds**, you can omit this parameter. In this case, Amazon EC2 allocates a Dedicated Host on each specified hardware asset. If you specify both **AssetIds** and **Quantity**, then the value that you specify for **Quantity** must be equal to the number of asset IDs specified.
|
187 199 | */
|
188 200 | public var quantity: kotlin.Int? = null
|
189 201 | /**
|
190 202 | * The tags to apply to the Dedicated Host during creation.
|
191 203 | */
|
192 204 | public var tagSpecifications: List<TagSpecification>? = null
|
193 205 |
|
194 206 | @PublishedApi
|
195 207 | internal constructor()
|
196 208 | @PublishedApi
|
197 209 | internal constructor(x: aws.sdk.kotlin.services.ec2.model.AllocateHostsRequest) : this() {
|
198 210 | this.assetIds = x.assetIds
|
199 211 | this.autoPlacement = x.autoPlacement
|
200 212 | this.availabilityZone = x.availabilityZone
|
201 213 | this.availabilityZoneId = x.availabilityZoneId
|
202 214 | this.clientToken = x.clientToken
|
215 + | this.cpuOptions = x.cpuOptions
|
203 216 | this.hostMaintenance = x.hostMaintenance
|
204 217 | this.hostRecovery = x.hostRecovery
|
205 218 | this.instanceFamily = x.instanceFamily
|
206 219 | this.instanceType = x.instanceType
|
207 220 | this.outpostArn = x.outpostArn
|
208 221 | this.quantity = x.quantity
|
209 222 | this.tagSpecifications = x.tagSpecifications
|
210 223 | }
|
211 224 |
|
212 225 | @PublishedApi
|
213 226 | internal fun build(): aws.sdk.kotlin.services.ec2.model.AllocateHostsRequest = AllocateHostsRequest(this)
|
214 227 |
|
228 + | /**
|
229 + | * construct an [aws.sdk.kotlin.services.ec2.model.HostCpuOptionsRequest] inside the given [block]
|
230 + | */
|
231 + | public fun cpuOptions(block: aws.sdk.kotlin.services.ec2.model.HostCpuOptionsRequest.Builder.() -> kotlin.Unit) {
|
232 + | this.cpuOptions = awsSdkKotlinServicesEc2ModelHostCpuOptionsRequestDslBuilderRef(block)
|
233 + | }
|
234 + |
|
215 235 | internal fun correctErrors(): Builder {
|
216 236 | return this
|
217 237 | }
|
218 238 | }
|
219 239 | }
|