aws_sdk_computeoptimizer/types/
_gpu.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes the GPU accelerators for the instance type.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Gpu {
7    /// <p>The number of GPUs for the instance type.</p>
8    pub gpu_count: i32,
9    /// <p>The total size of the memory for the GPU accelerators for the instance type, in MiB.</p>
10    pub gpu_memory_size_in_mib: i32,
11}
12impl Gpu {
13    /// <p>The number of GPUs for the instance type.</p>
14    pub fn gpu_count(&self) -> i32 {
15        self.gpu_count
16    }
17    /// <p>The total size of the memory for the GPU accelerators for the instance type, in MiB.</p>
18    pub fn gpu_memory_size_in_mib(&self) -> i32 {
19        self.gpu_memory_size_in_mib
20    }
21}
22impl Gpu {
23    /// Creates a new builder-style object to manufacture [`Gpu`](crate::types::Gpu).
24    pub fn builder() -> crate::types::builders::GpuBuilder {
25        crate::types::builders::GpuBuilder::default()
26    }
27}
28
29/// A builder for [`Gpu`](crate::types::Gpu).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct GpuBuilder {
33    pub(crate) gpu_count: ::std::option::Option<i32>,
34    pub(crate) gpu_memory_size_in_mib: ::std::option::Option<i32>,
35}
36impl GpuBuilder {
37    /// <p>The number of GPUs for the instance type.</p>
38    pub fn gpu_count(mut self, input: i32) -> Self {
39        self.gpu_count = ::std::option::Option::Some(input);
40        self
41    }
42    /// <p>The number of GPUs for the instance type.</p>
43    pub fn set_gpu_count(mut self, input: ::std::option::Option<i32>) -> Self {
44        self.gpu_count = input;
45        self
46    }
47    /// <p>The number of GPUs for the instance type.</p>
48    pub fn get_gpu_count(&self) -> &::std::option::Option<i32> {
49        &self.gpu_count
50    }
51    /// <p>The total size of the memory for the GPU accelerators for the instance type, in MiB.</p>
52    pub fn gpu_memory_size_in_mib(mut self, input: i32) -> Self {
53        self.gpu_memory_size_in_mib = ::std::option::Option::Some(input);
54        self
55    }
56    /// <p>The total size of the memory for the GPU accelerators for the instance type, in MiB.</p>
57    pub fn set_gpu_memory_size_in_mib(mut self, input: ::std::option::Option<i32>) -> Self {
58        self.gpu_memory_size_in_mib = input;
59        self
60    }
61    /// <p>The total size of the memory for the GPU accelerators for the instance type, in MiB.</p>
62    pub fn get_gpu_memory_size_in_mib(&self) -> &::std::option::Option<i32> {
63        &self.gpu_memory_size_in_mib
64    }
65    /// Consumes the builder and constructs a [`Gpu`](crate::types::Gpu).
66    pub fn build(self) -> crate::types::Gpu {
67        crate::types::Gpu {
68            gpu_count: self.gpu_count.unwrap_or_default(),
69            gpu_memory_size_in_mib: self.gpu_memory_size_in_mib.unwrap_or_default(),
70        }
71    }
72}