aws_sdk_codepipeline/types/
_blocker_declaration.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct BlockerDeclaration {
7 pub name: ::std::string::String,
9 pub r#type: crate::types::BlockerType,
11}
12impl BlockerDeclaration {
13 pub fn name(&self) -> &str {
15 use std::ops::Deref;
16 self.name.deref()
17 }
18 pub fn r#type(&self) -> &crate::types::BlockerType {
20 &self.r#type
21 }
22}
23impl BlockerDeclaration {
24 pub fn builder() -> crate::types::builders::BlockerDeclarationBuilder {
26 crate::types::builders::BlockerDeclarationBuilder::default()
27 }
28}
29
30#[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 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46 self.name = input;
47 self
48 }
49 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
51 &self.name
52 }
53 pub fn r#type(mut self, input: crate::types::BlockerType) -> Self {
56 self.r#type = ::std::option::Option::Some(input);
57 self
58 }
59 pub fn set_type(mut self, input: ::std::option::Option<crate::types::BlockerType>) -> Self {
61 self.r#type = input;
62 self
63 }
64 pub fn get_type(&self) -> &::std::option::Option<crate::types::BlockerType> {
66 &self.r#type
67 }
68 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}