aws_sdk_wafv2/types/
_label.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Label {
7 pub name: ::std::string::String,
9}
10impl Label {
11 pub fn name(&self) -> &str {
13 use std::ops::Deref;
14 self.name.deref()
15 }
16}
17impl Label {
18 pub fn builder() -> crate::types::builders::LabelBuilder {
20 crate::types::builders::LabelBuilder::default()
21 }
22}
23
24#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
26#[non_exhaustive]
27pub struct LabelBuilder {
28 pub(crate) name: ::std::option::Option<::std::string::String>,
29}
30impl LabelBuilder {
31 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
34 self.name = ::std::option::Option::Some(input.into());
35 self
36 }
37 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
39 self.name = input;
40 self
41 }
42 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
44 &self.name
45 }
46 pub fn build(self) -> ::std::result::Result<crate::types::Label, ::aws_smithy_types::error::operation::BuildError> {
50 ::std::result::Result::Ok(crate::types::Label {
51 name: self.name.ok_or_else(|| {
52 ::aws_smithy_types::error::operation::BuildError::missing_field(
53 "name",
54 "name was not specified but it is required when building Label",
55 )
56 })?,
57 })
58 }
59}