Skip to main content

aws_sdk_guardduty/types/
_product_code.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains information about the product code for the EC2 instance.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ProductCode {
7    /// <p>The product code information.</p>
8    pub code: ::std::option::Option<::std::string::String>,
9    /// <p>The product code type.</p>
10    pub product_type: ::std::option::Option<::std::string::String>,
11}
12impl ProductCode {
13    /// <p>The product code information.</p>
14    pub fn code(&self) -> ::std::option::Option<&str> {
15        self.code.as_deref()
16    }
17    /// <p>The product code type.</p>
18    pub fn product_type(&self) -> ::std::option::Option<&str> {
19        self.product_type.as_deref()
20    }
21}
22impl ProductCode {
23    /// Creates a new builder-style object to manufacture [`ProductCode`](crate::types::ProductCode).
24    pub fn builder() -> crate::types::builders::ProductCodeBuilder {
25        crate::types::builders::ProductCodeBuilder::default()
26    }
27}
28
29/// A builder for [`ProductCode`](crate::types::ProductCode).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct ProductCodeBuilder {
33    pub(crate) code: ::std::option::Option<::std::string::String>,
34    pub(crate) product_type: ::std::option::Option<::std::string::String>,
35}
36impl ProductCodeBuilder {
37    /// <p>The product code information.</p>
38    pub fn code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.code = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>The product code information.</p>
43    pub fn set_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.code = input;
45        self
46    }
47    /// <p>The product code information.</p>
48    pub fn get_code(&self) -> &::std::option::Option<::std::string::String> {
49        &self.code
50    }
51    /// <p>The product code type.</p>
52    pub fn product_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.product_type = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The product code type.</p>
57    pub fn set_product_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.product_type = input;
59        self
60    }
61    /// <p>The product code type.</p>
62    pub fn get_product_type(&self) -> &::std::option::Option<::std::string::String> {
63        &self.product_type
64    }
65    /// Consumes the builder and constructs a [`ProductCode`](crate::types::ProductCode).
66    pub fn build(self) -> crate::types::ProductCode {
67        crate::types::ProductCode {
68            code: self.code,
69            product_type: self.product_type,
70        }
71    }
72}