#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ProposedSegmentChange {
pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
pub attachment_policy_rule_number: ::std::option::Option<i32>,
pub segment_name: ::std::option::Option<::std::string::String>,
}
impl ProposedSegmentChange {
pub fn tags(&self) -> &[crate::types::Tag] {
self.tags.as_deref().unwrap_or_default()
}
pub fn attachment_policy_rule_number(&self) -> ::std::option::Option<i32> {
self.attachment_policy_rule_number
}
pub fn segment_name(&self) -> ::std::option::Option<&str> {
self.segment_name.as_deref()
}
}
impl ProposedSegmentChange {
pub fn builder() -> crate::types::builders::ProposedSegmentChangeBuilder {
crate::types::builders::ProposedSegmentChangeBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ProposedSegmentChangeBuilder {
pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
pub(crate) attachment_policy_rule_number: ::std::option::Option<i32>,
pub(crate) segment_name: ::std::option::Option<::std::string::String>,
}
impl ProposedSegmentChangeBuilder {
pub fn tags(mut self, input: crate::types::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = ::std::option::Option::Some(v);
self
}
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.tags = input;
self
}
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
&self.tags
}
pub fn attachment_policy_rule_number(mut self, input: i32) -> Self {
self.attachment_policy_rule_number = ::std::option::Option::Some(input);
self
}
pub fn set_attachment_policy_rule_number(mut self, input: ::std::option::Option<i32>) -> Self {
self.attachment_policy_rule_number = input;
self
}
pub fn get_attachment_policy_rule_number(&self) -> &::std::option::Option<i32> {
&self.attachment_policy_rule_number
}
pub fn segment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.segment_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_segment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.segment_name = input;
self
}
pub fn get_segment_name(&self) -> &::std::option::Option<::std::string::String> {
&self.segment_name
}
pub fn build(self) -> crate::types::ProposedSegmentChange {
crate::types::ProposedSegmentChange {
tags: self.tags,
attachment_policy_rule_number: self.attachment_policy_rule_number,
segment_name: self.segment_name,
}
}
}