Skip to main content

aws_sdk_customerprofiles/types/
_salesforce_source_properties.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The properties that are applied when Salesforce is being used as a source.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SalesforceSourceProperties {
7    /// <p>The object specified in the Salesforce flow source.</p>
8    pub object: ::std::string::String,
9    /// <p>The flag that enables dynamic fetching of new (recently added) fields in the Salesforce objects while running a flow.</p>
10    pub enable_dynamic_field_update: bool,
11    /// <p>Indicates whether Amazon AppFlow includes deleted files in the flow run.</p>
12    pub include_deleted_records: bool,
13}
14impl SalesforceSourceProperties {
15    /// <p>The object specified in the Salesforce flow source.</p>
16    pub fn object(&self) -> &str {
17        use std::ops::Deref;
18        self.object.deref()
19    }
20    /// <p>The flag that enables dynamic fetching of new (recently added) fields in the Salesforce objects while running a flow.</p>
21    pub fn enable_dynamic_field_update(&self) -> bool {
22        self.enable_dynamic_field_update
23    }
24    /// <p>Indicates whether Amazon AppFlow includes deleted files in the flow run.</p>
25    pub fn include_deleted_records(&self) -> bool {
26        self.include_deleted_records
27    }
28}
29impl SalesforceSourceProperties {
30    /// Creates a new builder-style object to manufacture [`SalesforceSourceProperties`](crate::types::SalesforceSourceProperties).
31    pub fn builder() -> crate::types::builders::SalesforceSourcePropertiesBuilder {
32        crate::types::builders::SalesforceSourcePropertiesBuilder::default()
33    }
34}
35
36/// A builder for [`SalesforceSourceProperties`](crate::types::SalesforceSourceProperties).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct SalesforceSourcePropertiesBuilder {
40    pub(crate) object: ::std::option::Option<::std::string::String>,
41    pub(crate) enable_dynamic_field_update: ::std::option::Option<bool>,
42    pub(crate) include_deleted_records: ::std::option::Option<bool>,
43}
44impl SalesforceSourcePropertiesBuilder {
45    /// <p>The object specified in the Salesforce flow source.</p>
46    /// This field is required.
47    pub fn object(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48        self.object = ::std::option::Option::Some(input.into());
49        self
50    }
51    /// <p>The object specified in the Salesforce flow source.</p>
52    pub fn set_object(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.object = input;
54        self
55    }
56    /// <p>The object specified in the Salesforce flow source.</p>
57    pub fn get_object(&self) -> &::std::option::Option<::std::string::String> {
58        &self.object
59    }
60    /// <p>The flag that enables dynamic fetching of new (recently added) fields in the Salesforce objects while running a flow.</p>
61    pub fn enable_dynamic_field_update(mut self, input: bool) -> Self {
62        self.enable_dynamic_field_update = ::std::option::Option::Some(input);
63        self
64    }
65    /// <p>The flag that enables dynamic fetching of new (recently added) fields in the Salesforce objects while running a flow.</p>
66    pub fn set_enable_dynamic_field_update(mut self, input: ::std::option::Option<bool>) -> Self {
67        self.enable_dynamic_field_update = input;
68        self
69    }
70    /// <p>The flag that enables dynamic fetching of new (recently added) fields in the Salesforce objects while running a flow.</p>
71    pub fn get_enable_dynamic_field_update(&self) -> &::std::option::Option<bool> {
72        &self.enable_dynamic_field_update
73    }
74    /// <p>Indicates whether Amazon AppFlow includes deleted files in the flow run.</p>
75    pub fn include_deleted_records(mut self, input: bool) -> Self {
76        self.include_deleted_records = ::std::option::Option::Some(input);
77        self
78    }
79    /// <p>Indicates whether Amazon AppFlow includes deleted files in the flow run.</p>
80    pub fn set_include_deleted_records(mut self, input: ::std::option::Option<bool>) -> Self {
81        self.include_deleted_records = input;
82        self
83    }
84    /// <p>Indicates whether Amazon AppFlow includes deleted files in the flow run.</p>
85    pub fn get_include_deleted_records(&self) -> &::std::option::Option<bool> {
86        &self.include_deleted_records
87    }
88    /// Consumes the builder and constructs a [`SalesforceSourceProperties`](crate::types::SalesforceSourceProperties).
89    /// This method will fail if any of the following fields are not set:
90    /// - [`object`](crate::types::builders::SalesforceSourcePropertiesBuilder::object)
91    pub fn build(self) -> ::std::result::Result<crate::types::SalesforceSourceProperties, ::aws_smithy_types::error::operation::BuildError> {
92        ::std::result::Result::Ok(crate::types::SalesforceSourceProperties {
93            object: self.object.ok_or_else(|| {
94                ::aws_smithy_types::error::operation::BuildError::missing_field(
95                    "object",
96                    "object was not specified but it is required when building SalesforceSourceProperties",
97                )
98            })?,
99            enable_dynamic_field_update: self.enable_dynamic_field_update.unwrap_or_default(),
100            include_deleted_records: self.include_deleted_records.unwrap_or_default(),
101        })
102    }
103}