1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p> The details of an Elastic Inference Accelerator type. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AcceleratorType {
/// <p> The name of the Elastic Inference Accelerator type. </p>
#[doc(hidden)]
pub accelerator_type_name: std::option::Option<std::string::String>,
/// <p> The memory information of the Elastic Inference Accelerator type. </p>
#[doc(hidden)]
pub memory_info: std::option::Option<crate::model::MemoryInfo>,
/// <p> The throughput information of the Elastic Inference Accelerator type. </p>
#[doc(hidden)]
pub throughput_info: std::option::Option<std::vec::Vec<crate::model::KeyValuePair>>,
}
impl AcceleratorType {
/// <p> The name of the Elastic Inference Accelerator type. </p>
pub fn accelerator_type_name(&self) -> std::option::Option<&str> {
self.accelerator_type_name.as_deref()
}
/// <p> The memory information of the Elastic Inference Accelerator type. </p>
pub fn memory_info(&self) -> std::option::Option<&crate::model::MemoryInfo> {
self.memory_info.as_ref()
}
/// <p> The throughput information of the Elastic Inference Accelerator type. </p>
pub fn throughput_info(&self) -> std::option::Option<&[crate::model::KeyValuePair]> {
self.throughput_info.as_deref()
}
}
/// See [`AcceleratorType`](crate::model::AcceleratorType).
pub mod accelerator_type {
/// A builder for [`AcceleratorType`](crate::model::AcceleratorType).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) accelerator_type_name: std::option::Option<std::string::String>,
pub(crate) memory_info: std::option::Option<crate::model::MemoryInfo>,
pub(crate) throughput_info: std::option::Option<std::vec::Vec<crate::model::KeyValuePair>>,
}
impl Builder {
/// <p> The name of the Elastic Inference Accelerator type. </p>
pub fn accelerator_type_name(mut self, input: impl Into<std::string::String>) -> Self {
self.accelerator_type_name = Some(input.into());
self
}
/// <p> The name of the Elastic Inference Accelerator type. </p>
pub fn set_accelerator_type_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.accelerator_type_name = input;
self
}
/// <p> The memory information of the Elastic Inference Accelerator type. </p>
pub fn memory_info(mut self, input: crate::model::MemoryInfo) -> Self {
self.memory_info = Some(input);
self
}
/// <p> The memory information of the Elastic Inference Accelerator type. </p>
pub fn set_memory_info(
mut self,
input: std::option::Option<crate::model::MemoryInfo>,
) -> Self {
self.memory_info = input;
self
}
/// Appends an item to `throughput_info`.
///
/// To override the contents of this collection use [`set_throughput_info`](Self::set_throughput_info).
///
/// <p> The throughput information of the Elastic Inference Accelerator type. </p>
pub fn throughput_info(mut self, input: crate::model::KeyValuePair) -> Self {
let mut v = self.throughput_info.unwrap_or_default();
v.push(input);
self.throughput_info = Some(v);
self
}
/// <p> The throughput information of the Elastic Inference Accelerator type. </p>
pub fn set_throughput_info(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::KeyValuePair>>,
) -> Self {
self.throughput_info = input;
self
}
/// Consumes the builder and constructs a [`AcceleratorType`](crate::model::AcceleratorType).
pub fn build(self) -> crate::model::AcceleratorType {
crate::model::AcceleratorType {
accelerator_type_name: self.accelerator_type_name,
memory_info: self.memory_info,
throughput_info: self.throughput_info,
}
}
}
}
impl AcceleratorType {
/// Creates a new builder-style object to manufacture [`AcceleratorType`](crate::model::AcceleratorType).
pub fn builder() -> crate::model::accelerator_type::Builder {
crate::model::accelerator_type::Builder::default()
}
}
/// <p> A throughput entry for an Elastic Inference Accelerator type. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct KeyValuePair {
/// <p> The throughput value of the Elastic Inference Accelerator type. It can assume the following values: TFLOPS16bit: the throughput expressed in 16bit TeraFLOPS. TFLOPS32bit: the throughput expressed in 32bit TeraFLOPS. </p>
#[doc(hidden)]
pub key: std::option::Option<std::string::String>,
/// <p> The throughput value of the Elastic Inference Accelerator type. </p>
#[doc(hidden)]
pub value: i32,
}
impl KeyValuePair {
/// <p> The throughput value of the Elastic Inference Accelerator type. It can assume the following values: TFLOPS16bit: the throughput expressed in 16bit TeraFLOPS. TFLOPS32bit: the throughput expressed in 32bit TeraFLOPS. </p>
pub fn key(&self) -> std::option::Option<&str> {
self.key.as_deref()
}
/// <p> The throughput value of the Elastic Inference Accelerator type. </p>
pub fn value(&self) -> i32 {
self.value
}
}
/// See [`KeyValuePair`](crate::model::KeyValuePair).
pub mod key_value_pair {
/// A builder for [`KeyValuePair`](crate::model::KeyValuePair).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) key: std::option::Option<std::string::String>,
pub(crate) value: std::option::Option<i32>,
}
impl Builder {
/// <p> The throughput value of the Elastic Inference Accelerator type. It can assume the following values: TFLOPS16bit: the throughput expressed in 16bit TeraFLOPS. TFLOPS32bit: the throughput expressed in 32bit TeraFLOPS. </p>
pub fn key(mut self, input: impl Into<std::string::String>) -> Self {
self.key = Some(input.into());
self
}
/// <p> The throughput value of the Elastic Inference Accelerator type. It can assume the following values: TFLOPS16bit: the throughput expressed in 16bit TeraFLOPS. TFLOPS32bit: the throughput expressed in 32bit TeraFLOPS. </p>
pub fn set_key(mut self, input: std::option::Option<std::string::String>) -> Self {
self.key = input;
self
}
/// <p> The throughput value of the Elastic Inference Accelerator type. </p>
pub fn value(mut self, input: i32) -> Self {
self.value = Some(input);
self
}
/// <p> The throughput value of the Elastic Inference Accelerator type. </p>
pub fn set_value(mut self, input: std::option::Option<i32>) -> Self {
self.value = input;
self
}
/// Consumes the builder and constructs a [`KeyValuePair`](crate::model::KeyValuePair).
pub fn build(self) -> crate::model::KeyValuePair {
crate::model::KeyValuePair {
key: self.key,
value: self.value.unwrap_or_default(),
}
}
}
}
impl KeyValuePair {
/// Creates a new builder-style object to manufacture [`KeyValuePair`](crate::model::KeyValuePair).
pub fn builder() -> crate::model::key_value_pair::Builder {
crate::model::key_value_pair::Builder::default()
}
}
/// <p> The memory information of an Elastic Inference Accelerator type. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct MemoryInfo {
/// <p> The size in mebibytes of the Elastic Inference Accelerator type. </p>
#[doc(hidden)]
pub size_in_mi_b: i32,
}
impl MemoryInfo {
/// <p> The size in mebibytes of the Elastic Inference Accelerator type. </p>
pub fn size_in_mi_b(&self) -> i32 {
self.size_in_mi_b
}
}
/// See [`MemoryInfo`](crate::model::MemoryInfo).
pub mod memory_info {
/// A builder for [`MemoryInfo`](crate::model::MemoryInfo).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) size_in_mi_b: std::option::Option<i32>,
}
impl Builder {
/// <p> The size in mebibytes of the Elastic Inference Accelerator type. </p>
pub fn size_in_mi_b(mut self, input: i32) -> Self {
self.size_in_mi_b = Some(input);
self
}
/// <p> The size in mebibytes of the Elastic Inference Accelerator type. </p>
pub fn set_size_in_mi_b(mut self, input: std::option::Option<i32>) -> Self {
self.size_in_mi_b = input;
self
}
/// Consumes the builder and constructs a [`MemoryInfo`](crate::model::MemoryInfo).
pub fn build(self) -> crate::model::MemoryInfo {
crate::model::MemoryInfo {
size_in_mi_b: self.size_in_mi_b.unwrap_or_default(),
}
}
}
}
impl MemoryInfo {
/// Creates a new builder-style object to manufacture [`MemoryInfo`](crate::model::MemoryInfo).
pub fn builder() -> crate::model::memory_info::Builder {
crate::model::memory_info::Builder::default()
}
}
/// <p> The details of an Elastic Inference Accelerator. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ElasticInferenceAccelerator {
/// <p> The health of the Elastic Inference Accelerator. </p>
#[doc(hidden)]
pub accelerator_health: std::option::Option<crate::model::ElasticInferenceAcceleratorHealth>,
/// <p> The type of the Elastic Inference Accelerator. </p>
#[doc(hidden)]
pub accelerator_type: std::option::Option<std::string::String>,
/// <p> The ID of the Elastic Inference Accelerator. </p>
#[doc(hidden)]
pub accelerator_id: std::option::Option<std::string::String>,
/// <p> The availability zone where the Elastic Inference Accelerator is present. </p>
#[doc(hidden)]
pub availability_zone: std::option::Option<std::string::String>,
/// <p> The ARN of the resource that the Elastic Inference Accelerator is attached to. </p>
#[doc(hidden)]
pub attached_resource: std::option::Option<std::string::String>,
}
impl ElasticInferenceAccelerator {
/// <p> The health of the Elastic Inference Accelerator. </p>
pub fn accelerator_health(
&self,
) -> std::option::Option<&crate::model::ElasticInferenceAcceleratorHealth> {
self.accelerator_health.as_ref()
}
/// <p> The type of the Elastic Inference Accelerator. </p>
pub fn accelerator_type(&self) -> std::option::Option<&str> {
self.accelerator_type.as_deref()
}
/// <p> The ID of the Elastic Inference Accelerator. </p>
pub fn accelerator_id(&self) -> std::option::Option<&str> {
self.accelerator_id.as_deref()
}
/// <p> The availability zone where the Elastic Inference Accelerator is present. </p>
pub fn availability_zone(&self) -> std::option::Option<&str> {
self.availability_zone.as_deref()
}
/// <p> The ARN of the resource that the Elastic Inference Accelerator is attached to. </p>
pub fn attached_resource(&self) -> std::option::Option<&str> {
self.attached_resource.as_deref()
}
}
/// See [`ElasticInferenceAccelerator`](crate::model::ElasticInferenceAccelerator).
pub mod elastic_inference_accelerator {
/// A builder for [`ElasticInferenceAccelerator`](crate::model::ElasticInferenceAccelerator).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) accelerator_health:
std::option::Option<crate::model::ElasticInferenceAcceleratorHealth>,
pub(crate) accelerator_type: std::option::Option<std::string::String>,
pub(crate) accelerator_id: std::option::Option<std::string::String>,
pub(crate) availability_zone: std::option::Option<std::string::String>,
pub(crate) attached_resource: std::option::Option<std::string::String>,
}
impl Builder {
/// <p> The health of the Elastic Inference Accelerator. </p>
pub fn accelerator_health(
mut self,
input: crate::model::ElasticInferenceAcceleratorHealth,
) -> Self {
self.accelerator_health = Some(input);
self
}
/// <p> The health of the Elastic Inference Accelerator. </p>
pub fn set_accelerator_health(
mut self,
input: std::option::Option<crate::model::ElasticInferenceAcceleratorHealth>,
) -> Self {
self.accelerator_health = input;
self
}
/// <p> The type of the Elastic Inference Accelerator. </p>
pub fn accelerator_type(mut self, input: impl Into<std::string::String>) -> Self {
self.accelerator_type = Some(input.into());
self
}
/// <p> The type of the Elastic Inference Accelerator. </p>
pub fn set_accelerator_type(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.accelerator_type = input;
self
}
/// <p> The ID of the Elastic Inference Accelerator. </p>
pub fn accelerator_id(mut self, input: impl Into<std::string::String>) -> Self {
self.accelerator_id = Some(input.into());
self
}
/// <p> The ID of the Elastic Inference Accelerator. </p>
pub fn set_accelerator_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.accelerator_id = input;
self
}
/// <p> The availability zone where the Elastic Inference Accelerator is present. </p>
pub fn availability_zone(mut self, input: impl Into<std::string::String>) -> Self {
self.availability_zone = Some(input.into());
self
}
/// <p> The availability zone where the Elastic Inference Accelerator is present. </p>
pub fn set_availability_zone(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.availability_zone = input;
self
}
/// <p> The ARN of the resource that the Elastic Inference Accelerator is attached to. </p>
pub fn attached_resource(mut self, input: impl Into<std::string::String>) -> Self {
self.attached_resource = Some(input.into());
self
}
/// <p> The ARN of the resource that the Elastic Inference Accelerator is attached to. </p>
pub fn set_attached_resource(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.attached_resource = input;
self
}
/// Consumes the builder and constructs a [`ElasticInferenceAccelerator`](crate::model::ElasticInferenceAccelerator).
pub fn build(self) -> crate::model::ElasticInferenceAccelerator {
crate::model::ElasticInferenceAccelerator {
accelerator_health: self.accelerator_health,
accelerator_type: self.accelerator_type,
accelerator_id: self.accelerator_id,
availability_zone: self.availability_zone,
attached_resource: self.attached_resource,
}
}
}
}
impl ElasticInferenceAccelerator {
/// Creates a new builder-style object to manufacture [`ElasticInferenceAccelerator`](crate::model::ElasticInferenceAccelerator).
pub fn builder() -> crate::model::elastic_inference_accelerator::Builder {
crate::model::elastic_inference_accelerator::Builder::default()
}
}
/// <p> The health details of an Elastic Inference Accelerator. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ElasticInferenceAcceleratorHealth {
/// <p> The health status of the Elastic Inference Accelerator. </p>
#[doc(hidden)]
pub status: std::option::Option<std::string::String>,
}
impl ElasticInferenceAcceleratorHealth {
/// <p> The health status of the Elastic Inference Accelerator. </p>
pub fn status(&self) -> std::option::Option<&str> {
self.status.as_deref()
}
}
/// See [`ElasticInferenceAcceleratorHealth`](crate::model::ElasticInferenceAcceleratorHealth).
pub mod elastic_inference_accelerator_health {
/// A builder for [`ElasticInferenceAcceleratorHealth`](crate::model::ElasticInferenceAcceleratorHealth).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) status: std::option::Option<std::string::String>,
}
impl Builder {
/// <p> The health status of the Elastic Inference Accelerator. </p>
pub fn status(mut self, input: impl Into<std::string::String>) -> Self {
self.status = Some(input.into());
self
}
/// <p> The health status of the Elastic Inference Accelerator. </p>
pub fn set_status(mut self, input: std::option::Option<std::string::String>) -> Self {
self.status = input;
self
}
/// Consumes the builder and constructs a [`ElasticInferenceAcceleratorHealth`](crate::model::ElasticInferenceAcceleratorHealth).
pub fn build(self) -> crate::model::ElasticInferenceAcceleratorHealth {
crate::model::ElasticInferenceAcceleratorHealth {
status: self.status,
}
}
}
}
impl ElasticInferenceAcceleratorHealth {
/// Creates a new builder-style object to manufacture [`ElasticInferenceAcceleratorHealth`](crate::model::ElasticInferenceAcceleratorHealth).
pub fn builder() -> crate::model::elastic_inference_accelerator_health::Builder {
crate::model::elastic_inference_accelerator_health::Builder::default()
}
}
/// <p> A filter expression for the Elastic Inference Accelerator list. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Filter {
/// <p> The filter name for the Elastic Inference Accelerator list. It can assume the following values: accelerator-type: the type of Elastic Inference Accelerator to filter for. instance-id: an EC2 instance id to filter for. </p>
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
/// <p> The values for the filter of the Elastic Inference Accelerator list. </p>
#[doc(hidden)]
pub values: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Filter {
/// <p> The filter name for the Elastic Inference Accelerator list. It can assume the following values: accelerator-type: the type of Elastic Inference Accelerator to filter for. instance-id: an EC2 instance id to filter for. </p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p> The values for the filter of the Elastic Inference Accelerator list. </p>
pub fn values(&self) -> std::option::Option<&[std::string::String]> {
self.values.as_deref()
}
}
/// See [`Filter`](crate::model::Filter).
pub mod filter {
/// A builder for [`Filter`](crate::model::Filter).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) values: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
/// <p> The filter name for the Elastic Inference Accelerator list. It can assume the following values: accelerator-type: the type of Elastic Inference Accelerator to filter for. instance-id: an EC2 instance id to filter for. </p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p> The filter name for the Elastic Inference Accelerator list. It can assume the following values: accelerator-type: the type of Elastic Inference Accelerator to filter for. instance-id: an EC2 instance id to filter for. </p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// Appends an item to `values`.
///
/// To override the contents of this collection use [`set_values`](Self::set_values).
///
/// <p> The values for the filter of the Elastic Inference Accelerator list. </p>
pub fn values(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.values.unwrap_or_default();
v.push(input.into());
self.values = Some(v);
self
}
/// <p> The values for the filter of the Elastic Inference Accelerator list. </p>
pub fn set_values(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.values = input;
self
}
/// Consumes the builder and constructs a [`Filter`](crate::model::Filter).
pub fn build(self) -> crate::model::Filter {
crate::model::Filter {
name: self.name,
values: self.values,
}
}
}
}
impl Filter {
/// Creates a new builder-style object to manufacture [`Filter`](crate::model::Filter).
pub fn builder() -> crate::model::filter::Builder {
crate::model::filter::Builder::default()
}
}
/// <p> The offering for an Elastic Inference Accelerator type. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AcceleratorTypeOffering {
/// <p> The name of the Elastic Inference Accelerator type. </p>
#[doc(hidden)]
pub accelerator_type: std::option::Option<std::string::String>,
/// <p> The location type for the offering. It can assume the following values: region: defines that the offering is at the regional level. availability-zone: defines that the offering is at the availability zone level. availability-zone-id: defines that the offering is at the availability zone level, defined by the availability zone id. </p>
#[doc(hidden)]
pub location_type: std::option::Option<crate::model::LocationType>,
/// <p> The location for the offering. It will return either the region, availability zone or availability zone id for the offering depending on the locationType value. </p>
#[doc(hidden)]
pub location: std::option::Option<std::string::String>,
}
impl AcceleratorTypeOffering {
/// <p> The name of the Elastic Inference Accelerator type. </p>
pub fn accelerator_type(&self) -> std::option::Option<&str> {
self.accelerator_type.as_deref()
}
/// <p> The location type for the offering. It can assume the following values: region: defines that the offering is at the regional level. availability-zone: defines that the offering is at the availability zone level. availability-zone-id: defines that the offering is at the availability zone level, defined by the availability zone id. </p>
pub fn location_type(&self) -> std::option::Option<&crate::model::LocationType> {
self.location_type.as_ref()
}
/// <p> The location for the offering. It will return either the region, availability zone or availability zone id for the offering depending on the locationType value. </p>
pub fn location(&self) -> std::option::Option<&str> {
self.location.as_deref()
}
}
/// See [`AcceleratorTypeOffering`](crate::model::AcceleratorTypeOffering).
pub mod accelerator_type_offering {
/// A builder for [`AcceleratorTypeOffering`](crate::model::AcceleratorTypeOffering).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) accelerator_type: std::option::Option<std::string::String>,
pub(crate) location_type: std::option::Option<crate::model::LocationType>,
pub(crate) location: std::option::Option<std::string::String>,
}
impl Builder {
/// <p> The name of the Elastic Inference Accelerator type. </p>
pub fn accelerator_type(mut self, input: impl Into<std::string::String>) -> Self {
self.accelerator_type = Some(input.into());
self
}
/// <p> The name of the Elastic Inference Accelerator type. </p>
pub fn set_accelerator_type(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.accelerator_type = input;
self
}
/// <p> The location type for the offering. It can assume the following values: region: defines that the offering is at the regional level. availability-zone: defines that the offering is at the availability zone level. availability-zone-id: defines that the offering is at the availability zone level, defined by the availability zone id. </p>
pub fn location_type(mut self, input: crate::model::LocationType) -> Self {
self.location_type = Some(input);
self
}
/// <p> The location type for the offering. It can assume the following values: region: defines that the offering is at the regional level. availability-zone: defines that the offering is at the availability zone level. availability-zone-id: defines that the offering is at the availability zone level, defined by the availability zone id. </p>
pub fn set_location_type(
mut self,
input: std::option::Option<crate::model::LocationType>,
) -> Self {
self.location_type = input;
self
}
/// <p> The location for the offering. It will return either the region, availability zone or availability zone id for the offering depending on the locationType value. </p>
pub fn location(mut self, input: impl Into<std::string::String>) -> Self {
self.location = Some(input.into());
self
}
/// <p> The location for the offering. It will return either the region, availability zone or availability zone id for the offering depending on the locationType value. </p>
pub fn set_location(mut self, input: std::option::Option<std::string::String>) -> Self {
self.location = input;
self
}
/// Consumes the builder and constructs a [`AcceleratorTypeOffering`](crate::model::AcceleratorTypeOffering).
pub fn build(self) -> crate::model::AcceleratorTypeOffering {
crate::model::AcceleratorTypeOffering {
accelerator_type: self.accelerator_type,
location_type: self.location_type,
location: self.location,
}
}
}
}
impl AcceleratorTypeOffering {
/// Creates a new builder-style object to manufacture [`AcceleratorTypeOffering`](crate::model::AcceleratorTypeOffering).
pub fn builder() -> crate::model::accelerator_type_offering::Builder {
crate::model::accelerator_type_offering::Builder::default()
}
}
/// When writing a match expression against `LocationType`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let locationtype = unimplemented!();
/// match locationtype {
/// LocationType::AvailabilityZone => { /* ... */ },
/// LocationType::AvailabilityZoneId => { /* ... */ },
/// LocationType::Region => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `locationtype` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `LocationType::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `LocationType::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `LocationType::NewFeature` is defined.
/// Specifically, when `locationtype` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `LocationType::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum LocationType {
#[allow(missing_docs)] // documentation missing in model
AvailabilityZone,
#[allow(missing_docs)] // documentation missing in model
AvailabilityZoneId,
#[allow(missing_docs)] // documentation missing in model
Region,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for LocationType {
fn from(s: &str) -> Self {
match s {
"availability-zone" => LocationType::AvailabilityZone,
"availability-zone-id" => LocationType::AvailabilityZoneId,
"region" => LocationType::Region,
other => LocationType::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for LocationType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(LocationType::from(s))
}
}
impl LocationType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
LocationType::AvailabilityZone => "availability-zone",
LocationType::AvailabilityZoneId => "availability-zone-id",
LocationType::Region => "region",
LocationType::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["availability-zone", "availability-zone-id", "region"]
}
}
impl AsRef<str> for LocationType {
fn as_ref(&self) -> &str {
self.as_str()
}
}