Skip to main content

aws_sdk_ec2/operation/create_fpga_image/
_create_fpga_image_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateFpgaImageInput {
6    /// <p>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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
7    pub dry_run: ::std::option::Option<bool>,
8    /// <p>The location of the encrypted design checkpoint in Amazon S3. The input must be a tarball.</p>
9    pub input_storage_location: ::std::option::Option<crate::types::StorageLocation>,
10    /// <p>The location in Amazon S3 for the output logs.</p>
11    pub logs_storage_location: ::std::option::Option<crate::types::StorageLocation>,
12    /// <p>A description for the AFI.</p>
13    pub description: ::std::option::Option<::std::string::String>,
14    /// <p>A name for the AFI.</p>
15    pub name: ::std::option::Option<::std::string::String>,
16    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring Idempotency</a>.</p>
17    pub client_token: ::std::option::Option<::std::string::String>,
18    /// <p>The tags to apply to the FPGA image during creation.</p>
19    pub tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
20}
21impl CreateFpgaImageInput {
22    /// <p>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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
23    pub fn dry_run(&self) -> ::std::option::Option<bool> {
24        self.dry_run
25    }
26    /// <p>The location of the encrypted design checkpoint in Amazon S3. The input must be a tarball.</p>
27    pub fn input_storage_location(&self) -> ::std::option::Option<&crate::types::StorageLocation> {
28        self.input_storage_location.as_ref()
29    }
30    /// <p>The location in Amazon S3 for the output logs.</p>
31    pub fn logs_storage_location(&self) -> ::std::option::Option<&crate::types::StorageLocation> {
32        self.logs_storage_location.as_ref()
33    }
34    /// <p>A description for the AFI.</p>
35    pub fn description(&self) -> ::std::option::Option<&str> {
36        self.description.as_deref()
37    }
38    /// <p>A name for the AFI.</p>
39    pub fn name(&self) -> ::std::option::Option<&str> {
40        self.name.as_deref()
41    }
42    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring Idempotency</a>.</p>
43    pub fn client_token(&self) -> ::std::option::Option<&str> {
44        self.client_token.as_deref()
45    }
46    /// <p>The tags to apply to the FPGA image during creation.</p>
47    ///
48    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tag_specifications.is_none()`.
49    pub fn tag_specifications(&self) -> &[crate::types::TagSpecification] {
50        self.tag_specifications.as_deref().unwrap_or_default()
51    }
52}
53impl CreateFpgaImageInput {
54    /// Creates a new builder-style object to manufacture [`CreateFpgaImageInput`](crate::operation::create_fpga_image::CreateFpgaImageInput).
55    pub fn builder() -> crate::operation::create_fpga_image::builders::CreateFpgaImageInputBuilder {
56        crate::operation::create_fpga_image::builders::CreateFpgaImageInputBuilder::default()
57    }
58}
59
60/// A builder for [`CreateFpgaImageInput`](crate::operation::create_fpga_image::CreateFpgaImageInput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct CreateFpgaImageInputBuilder {
64    pub(crate) dry_run: ::std::option::Option<bool>,
65    pub(crate) input_storage_location: ::std::option::Option<crate::types::StorageLocation>,
66    pub(crate) logs_storage_location: ::std::option::Option<crate::types::StorageLocation>,
67    pub(crate) description: ::std::option::Option<::std::string::String>,
68    pub(crate) name: ::std::option::Option<::std::string::String>,
69    pub(crate) client_token: ::std::option::Option<::std::string::String>,
70    pub(crate) tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
71}
72impl CreateFpgaImageInputBuilder {
73    /// <p>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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
74    pub fn dry_run(mut self, input: bool) -> Self {
75        self.dry_run = ::std::option::Option::Some(input);
76        self
77    }
78    /// <p>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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
79    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
80        self.dry_run = input;
81        self
82    }
83    /// <p>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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
84    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
85        &self.dry_run
86    }
87    /// <p>The location of the encrypted design checkpoint in Amazon S3. The input must be a tarball.</p>
88    /// This field is required.
89    pub fn input_storage_location(mut self, input: crate::types::StorageLocation) -> Self {
90        self.input_storage_location = ::std::option::Option::Some(input);
91        self
92    }
93    /// <p>The location of the encrypted design checkpoint in Amazon S3. The input must be a tarball.</p>
94    pub fn set_input_storage_location(mut self, input: ::std::option::Option<crate::types::StorageLocation>) -> Self {
95        self.input_storage_location = input;
96        self
97    }
98    /// <p>The location of the encrypted design checkpoint in Amazon S3. The input must be a tarball.</p>
99    pub fn get_input_storage_location(&self) -> &::std::option::Option<crate::types::StorageLocation> {
100        &self.input_storage_location
101    }
102    /// <p>The location in Amazon S3 for the output logs.</p>
103    pub fn logs_storage_location(mut self, input: crate::types::StorageLocation) -> Self {
104        self.logs_storage_location = ::std::option::Option::Some(input);
105        self
106    }
107    /// <p>The location in Amazon S3 for the output logs.</p>
108    pub fn set_logs_storage_location(mut self, input: ::std::option::Option<crate::types::StorageLocation>) -> Self {
109        self.logs_storage_location = input;
110        self
111    }
112    /// <p>The location in Amazon S3 for the output logs.</p>
113    pub fn get_logs_storage_location(&self) -> &::std::option::Option<crate::types::StorageLocation> {
114        &self.logs_storage_location
115    }
116    /// <p>A description for the AFI.</p>
117    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.description = ::std::option::Option::Some(input.into());
119        self
120    }
121    /// <p>A description for the AFI.</p>
122    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.description = input;
124        self
125    }
126    /// <p>A description for the AFI.</p>
127    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
128        &self.description
129    }
130    /// <p>A name for the AFI.</p>
131    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.name = ::std::option::Option::Some(input.into());
133        self
134    }
135    /// <p>A name for the AFI.</p>
136    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.name = input;
138        self
139    }
140    /// <p>A name for the AFI.</p>
141    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
142        &self.name
143    }
144    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring Idempotency</a>.</p>
145    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.client_token = ::std::option::Option::Some(input.into());
147        self
148    }
149    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring Idempotency</a>.</p>
150    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.client_token = input;
152        self
153    }
154    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring Idempotency</a>.</p>
155    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
156        &self.client_token
157    }
158    /// Appends an item to `tag_specifications`.
159    ///
160    /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
161    ///
162    /// <p>The tags to apply to the FPGA image during creation.</p>
163    pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
164        let mut v = self.tag_specifications.unwrap_or_default();
165        v.push(input);
166        self.tag_specifications = ::std::option::Option::Some(v);
167        self
168    }
169    /// <p>The tags to apply to the FPGA image during creation.</p>
170    pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
171        self.tag_specifications = input;
172        self
173    }
174    /// <p>The tags to apply to the FPGA image during creation.</p>
175    pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
176        &self.tag_specifications
177    }
178    /// Consumes the builder and constructs a [`CreateFpgaImageInput`](crate::operation::create_fpga_image::CreateFpgaImageInput).
179    pub fn build(
180        self,
181    ) -> ::std::result::Result<crate::operation::create_fpga_image::CreateFpgaImageInput, ::aws_smithy_types::error::operation::BuildError> {
182        ::std::result::Result::Ok(crate::operation::create_fpga_image::CreateFpgaImageInput {
183            dry_run: self.dry_run,
184            input_storage_location: self.input_storage_location,
185            logs_storage_location: self.logs_storage_location,
186            description: self.description,
187            name: self.name,
188            client_token: self.client_token,
189            tag_specifications: self.tag_specifications,
190        })
191    }
192}