aws_sdk_codepipeline/types/
_blocker_declaration.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Reserved for future use.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct BlockerDeclaration {
7    /// <p>Reserved for future use.</p>
8    pub name: ::std::string::String,
9    /// <p>Reserved for future use.</p>
10    pub r#type: crate::types::BlockerType,
11}
12impl BlockerDeclaration {
13    /// <p>Reserved for future use.</p>
14    pub fn name(&self) -> &str {
15        use std::ops::Deref;
16        self.name.deref()
17    }
18    /// <p>Reserved for future use.</p>
19    pub fn r#type(&self) -> &crate::types::BlockerType {
20        &self.r#type
21    }
22}
23impl BlockerDeclaration {
24    /// Creates a new builder-style object to manufacture [`BlockerDeclaration`](crate::types::BlockerDeclaration).
25    pub fn builder() -> crate::types::builders::BlockerDeclarationBuilder {
26        crate::types::builders::BlockerDeclarationBuilder::default()
27    }
28}
29
30/// A builder for [`BlockerDeclaration`](crate::types::BlockerDeclaration).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct BlockerDeclarationBuilder {
34    pub(crate) name: ::std::option::Option<::std::string::String>,
35    pub(crate) r#type: ::std::option::Option<crate::types::BlockerType>,
36}
37impl BlockerDeclarationBuilder {
38    /// <p>Reserved for future use.</p>
39    /// This field is required.
40    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41        self.name = ::std::option::Option::Some(input.into());
42        self
43    }
44    /// <p>Reserved for future use.</p>
45    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46        self.name = input;
47        self
48    }
49    /// <p>Reserved for future use.</p>
50    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
51        &self.name
52    }
53    /// <p>Reserved for future use.</p>
54    /// This field is required.
55    pub fn r#type(mut self, input: crate::types::BlockerType) -> Self {
56        self.r#type = ::std::option::Option::Some(input);
57        self
58    }
59    /// <p>Reserved for future use.</p>
60    pub fn set_type(mut self, input: ::std::option::Option<crate::types::BlockerType>) -> Self {
61        self.r#type = input;
62        self
63    }
64    /// <p>Reserved for future use.</p>
65    pub fn get_type(&self) -> &::std::option::Option<crate::types::BlockerType> {
66        &self.r#type
67    }
68    /// Consumes the builder and constructs a [`BlockerDeclaration`](crate::types::BlockerDeclaration).
69    /// This method will fail if any of the following fields are not set:
70    /// - [`name`](crate::types::builders::BlockerDeclarationBuilder::name)
71    /// - [`r#type`](crate::types::builders::BlockerDeclarationBuilder::type)
72    pub fn build(self) -> ::std::result::Result<crate::types::BlockerDeclaration, ::aws_smithy_types::error::operation::BuildError> {
73        ::std::result::Result::Ok(crate::types::BlockerDeclaration {
74            name: self.name.ok_or_else(|| {
75                ::aws_smithy_types::error::operation::BuildError::missing_field(
76                    "name",
77                    "name was not specified but it is required when building BlockerDeclaration",
78                )
79            })?,
80            r#type: self.r#type.ok_or_else(|| {
81                ::aws_smithy_types::error::operation::BuildError::missing_field(
82                    "r#type",
83                    "r#type was not specified but it is required when building BlockerDeclaration",
84                )
85            })?,
86        })
87    }
88}