aws_sdk_pinpoint/operation/update_segment/
_update_segment_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateSegmentInput {
6    /// <p>The unique identifier for the application. This identifier is displayed as the <b>Project ID</b> on the Amazon Pinpoint console.</p>
7    pub application_id: ::std::option::Option<::std::string::String>,
8    /// <p>The unique identifier for the segment.</p>
9    pub segment_id: ::std::option::Option<::std::string::String>,
10    /// <p>Specifies the configuration, dimension, and other settings for a segment. A WriteSegmentRequest object can include a Dimensions object or a SegmentGroups object, but not both.</p>
11    pub write_segment_request: ::std::option::Option<crate::types::WriteSegmentRequest>,
12}
13impl UpdateSegmentInput {
14    /// <p>The unique identifier for the application. This identifier is displayed as the <b>Project ID</b> on the Amazon Pinpoint console.</p>
15    pub fn application_id(&self) -> ::std::option::Option<&str> {
16        self.application_id.as_deref()
17    }
18    /// <p>The unique identifier for the segment.</p>
19    pub fn segment_id(&self) -> ::std::option::Option<&str> {
20        self.segment_id.as_deref()
21    }
22    /// <p>Specifies the configuration, dimension, and other settings for a segment. A WriteSegmentRequest object can include a Dimensions object or a SegmentGroups object, but not both.</p>
23    pub fn write_segment_request(&self) -> ::std::option::Option<&crate::types::WriteSegmentRequest> {
24        self.write_segment_request.as_ref()
25    }
26}
27impl UpdateSegmentInput {
28    /// Creates a new builder-style object to manufacture [`UpdateSegmentInput`](crate::operation::update_segment::UpdateSegmentInput).
29    pub fn builder() -> crate::operation::update_segment::builders::UpdateSegmentInputBuilder {
30        crate::operation::update_segment::builders::UpdateSegmentInputBuilder::default()
31    }
32}
33
34/// A builder for [`UpdateSegmentInput`](crate::operation::update_segment::UpdateSegmentInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct UpdateSegmentInputBuilder {
38    pub(crate) application_id: ::std::option::Option<::std::string::String>,
39    pub(crate) segment_id: ::std::option::Option<::std::string::String>,
40    pub(crate) write_segment_request: ::std::option::Option<crate::types::WriteSegmentRequest>,
41}
42impl UpdateSegmentInputBuilder {
43    /// <p>The unique identifier for the application. This identifier is displayed as the <b>Project ID</b> on the Amazon Pinpoint console.</p>
44    /// This field is required.
45    pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46        self.application_id = ::std::option::Option::Some(input.into());
47        self
48    }
49    /// <p>The unique identifier for the application. This identifier is displayed as the <b>Project ID</b> on the Amazon Pinpoint console.</p>
50    pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51        self.application_id = input;
52        self
53    }
54    /// <p>The unique identifier for the application. This identifier is displayed as the <b>Project ID</b> on the Amazon Pinpoint console.</p>
55    pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
56        &self.application_id
57    }
58    /// <p>The unique identifier for the segment.</p>
59    /// This field is required.
60    pub fn segment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.segment_id = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>The unique identifier for the segment.</p>
65    pub fn set_segment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.segment_id = input;
67        self
68    }
69    /// <p>The unique identifier for the segment.</p>
70    pub fn get_segment_id(&self) -> &::std::option::Option<::std::string::String> {
71        &self.segment_id
72    }
73    /// <p>Specifies the configuration, dimension, and other settings for a segment. A WriteSegmentRequest object can include a Dimensions object or a SegmentGroups object, but not both.</p>
74    /// This field is required.
75    pub fn write_segment_request(mut self, input: crate::types::WriteSegmentRequest) -> Self {
76        self.write_segment_request = ::std::option::Option::Some(input);
77        self
78    }
79    /// <p>Specifies the configuration, dimension, and other settings for a segment. A WriteSegmentRequest object can include a Dimensions object or a SegmentGroups object, but not both.</p>
80    pub fn set_write_segment_request(mut self, input: ::std::option::Option<crate::types::WriteSegmentRequest>) -> Self {
81        self.write_segment_request = input;
82        self
83    }
84    /// <p>Specifies the configuration, dimension, and other settings for a segment. A WriteSegmentRequest object can include a Dimensions object or a SegmentGroups object, but not both.</p>
85    pub fn get_write_segment_request(&self) -> &::std::option::Option<crate::types::WriteSegmentRequest> {
86        &self.write_segment_request
87    }
88    /// Consumes the builder and constructs a [`UpdateSegmentInput`](crate::operation::update_segment::UpdateSegmentInput).
89    pub fn build(
90        self,
91    ) -> ::std::result::Result<crate::operation::update_segment::UpdateSegmentInput, ::aws_smithy_types::error::operation::BuildError> {
92        ::std::result::Result::Ok(crate::operation::update_segment::UpdateSegmentInput {
93            application_id: self.application_id,
94            segment_id: self.segment_id,
95            write_segment_request: self.write_segment_request,
96        })
97    }
98}