aws_sdk_transfer/operation/create_profile/_create_profile_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 CreateProfileInput {
6 /// <p>The <code>As2Id</code> is the <i>AS2-name</i>, as defined in the <a href="https://datatracker.ietf.org/doc/html/rfc4130">RFC 4130</a>. For inbound transfers, this is the <code>AS2-From</code> header for the AS2 messages sent from the partner. For outbound connectors, this is the <code>AS2-To</code> header for the AS2 messages sent to the partner using the <code>StartFileTransfer</code> API operation. This ID cannot include spaces.</p>
7 pub as2_id: ::std::option::Option<::std::string::String>,
8 /// <p>Determines the type of profile to create:</p>
9 /// <ul>
10 /// <li>
11 /// <p>Specify <code>LOCAL</code> to create a local profile. A local profile represents the AS2-enabled Transfer Family server organization or party.</p></li>
12 /// <li>
13 /// <p>Specify <code>PARTNER</code> to create a partner profile. A partner profile represents a remote organization, external to Transfer Family.</p></li>
14 /// </ul>
15 pub profile_type: ::std::option::Option<crate::types::ProfileType>,
16 /// <p>An array of identifiers for the imported certificates. You use this identifier for working with profiles and partner profiles.</p>
17 pub certificate_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
18 /// <p>Key-value pairs that can be used to group and search for AS2 profiles.</p>
19 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
20}
21impl CreateProfileInput {
22 /// <p>The <code>As2Id</code> is the <i>AS2-name</i>, as defined in the <a href="https://datatracker.ietf.org/doc/html/rfc4130">RFC 4130</a>. For inbound transfers, this is the <code>AS2-From</code> header for the AS2 messages sent from the partner. For outbound connectors, this is the <code>AS2-To</code> header for the AS2 messages sent to the partner using the <code>StartFileTransfer</code> API operation. This ID cannot include spaces.</p>
23 pub fn as2_id(&self) -> ::std::option::Option<&str> {
24 self.as2_id.as_deref()
25 }
26 /// <p>Determines the type of profile to create:</p>
27 /// <ul>
28 /// <li>
29 /// <p>Specify <code>LOCAL</code> to create a local profile. A local profile represents the AS2-enabled Transfer Family server organization or party.</p></li>
30 /// <li>
31 /// <p>Specify <code>PARTNER</code> to create a partner profile. A partner profile represents a remote organization, external to Transfer Family.</p></li>
32 /// </ul>
33 pub fn profile_type(&self) -> ::std::option::Option<&crate::types::ProfileType> {
34 self.profile_type.as_ref()
35 }
36 /// <p>An array of identifiers for the imported certificates. You use this identifier for working with profiles and partner profiles.</p>
37 ///
38 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.certificate_ids.is_none()`.
39 pub fn certificate_ids(&self) -> &[::std::string::String] {
40 self.certificate_ids.as_deref().unwrap_or_default()
41 }
42 /// <p>Key-value pairs that can be used to group and search for AS2 profiles.</p>
43 ///
44 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
45 pub fn tags(&self) -> &[crate::types::Tag] {
46 self.tags.as_deref().unwrap_or_default()
47 }
48}
49impl CreateProfileInput {
50 /// Creates a new builder-style object to manufacture [`CreateProfileInput`](crate::operation::create_profile::CreateProfileInput).
51 pub fn builder() -> crate::operation::create_profile::builders::CreateProfileInputBuilder {
52 crate::operation::create_profile::builders::CreateProfileInputBuilder::default()
53 }
54}
55
56/// A builder for [`CreateProfileInput`](crate::operation::create_profile::CreateProfileInput).
57#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct CreateProfileInputBuilder {
60 pub(crate) as2_id: ::std::option::Option<::std::string::String>,
61 pub(crate) profile_type: ::std::option::Option<crate::types::ProfileType>,
62 pub(crate) certificate_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
63 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
64}
65impl CreateProfileInputBuilder {
66 /// <p>The <code>As2Id</code> is the <i>AS2-name</i>, as defined in the <a href="https://datatracker.ietf.org/doc/html/rfc4130">RFC 4130</a>. For inbound transfers, this is the <code>AS2-From</code> header for the AS2 messages sent from the partner. For outbound connectors, this is the <code>AS2-To</code> header for the AS2 messages sent to the partner using the <code>StartFileTransfer</code> API operation. This ID cannot include spaces.</p>
67 /// This field is required.
68 pub fn as2_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69 self.as2_id = ::std::option::Option::Some(input.into());
70 self
71 }
72 /// <p>The <code>As2Id</code> is the <i>AS2-name</i>, as defined in the <a href="https://datatracker.ietf.org/doc/html/rfc4130">RFC 4130</a>. For inbound transfers, this is the <code>AS2-From</code> header for the AS2 messages sent from the partner. For outbound connectors, this is the <code>AS2-To</code> header for the AS2 messages sent to the partner using the <code>StartFileTransfer</code> API operation. This ID cannot include spaces.</p>
73 pub fn set_as2_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74 self.as2_id = input;
75 self
76 }
77 /// <p>The <code>As2Id</code> is the <i>AS2-name</i>, as defined in the <a href="https://datatracker.ietf.org/doc/html/rfc4130">RFC 4130</a>. For inbound transfers, this is the <code>AS2-From</code> header for the AS2 messages sent from the partner. For outbound connectors, this is the <code>AS2-To</code> header for the AS2 messages sent to the partner using the <code>StartFileTransfer</code> API operation. This ID cannot include spaces.</p>
78 pub fn get_as2_id(&self) -> &::std::option::Option<::std::string::String> {
79 &self.as2_id
80 }
81 /// <p>Determines the type of profile to create:</p>
82 /// <ul>
83 /// <li>
84 /// <p>Specify <code>LOCAL</code> to create a local profile. A local profile represents the AS2-enabled Transfer Family server organization or party.</p></li>
85 /// <li>
86 /// <p>Specify <code>PARTNER</code> to create a partner profile. A partner profile represents a remote organization, external to Transfer Family.</p></li>
87 /// </ul>
88 /// This field is required.
89 pub fn profile_type(mut self, input: crate::types::ProfileType) -> Self {
90 self.profile_type = ::std::option::Option::Some(input);
91 self
92 }
93 /// <p>Determines the type of profile to create:</p>
94 /// <ul>
95 /// <li>
96 /// <p>Specify <code>LOCAL</code> to create a local profile. A local profile represents the AS2-enabled Transfer Family server organization or party.</p></li>
97 /// <li>
98 /// <p>Specify <code>PARTNER</code> to create a partner profile. A partner profile represents a remote organization, external to Transfer Family.</p></li>
99 /// </ul>
100 pub fn set_profile_type(mut self, input: ::std::option::Option<crate::types::ProfileType>) -> Self {
101 self.profile_type = input;
102 self
103 }
104 /// <p>Determines the type of profile to create:</p>
105 /// <ul>
106 /// <li>
107 /// <p>Specify <code>LOCAL</code> to create a local profile. A local profile represents the AS2-enabled Transfer Family server organization or party.</p></li>
108 /// <li>
109 /// <p>Specify <code>PARTNER</code> to create a partner profile. A partner profile represents a remote organization, external to Transfer Family.</p></li>
110 /// </ul>
111 pub fn get_profile_type(&self) -> &::std::option::Option<crate::types::ProfileType> {
112 &self.profile_type
113 }
114 /// Appends an item to `certificate_ids`.
115 ///
116 /// To override the contents of this collection use [`set_certificate_ids`](Self::set_certificate_ids).
117 ///
118 /// <p>An array of identifiers for the imported certificates. You use this identifier for working with profiles and partner profiles.</p>
119 pub fn certificate_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120 let mut v = self.certificate_ids.unwrap_or_default();
121 v.push(input.into());
122 self.certificate_ids = ::std::option::Option::Some(v);
123 self
124 }
125 /// <p>An array of identifiers for the imported certificates. You use this identifier for working with profiles and partner profiles.</p>
126 pub fn set_certificate_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
127 self.certificate_ids = input;
128 self
129 }
130 /// <p>An array of identifiers for the imported certificates. You use this identifier for working with profiles and partner profiles.</p>
131 pub fn get_certificate_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
132 &self.certificate_ids
133 }
134 /// Appends an item to `tags`.
135 ///
136 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
137 ///
138 /// <p>Key-value pairs that can be used to group and search for AS2 profiles.</p>
139 pub fn tags(mut self, input: crate::types::Tag) -> Self {
140 let mut v = self.tags.unwrap_or_default();
141 v.push(input);
142 self.tags = ::std::option::Option::Some(v);
143 self
144 }
145 /// <p>Key-value pairs that can be used to group and search for AS2 profiles.</p>
146 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
147 self.tags = input;
148 self
149 }
150 /// <p>Key-value pairs that can be used to group and search for AS2 profiles.</p>
151 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
152 &self.tags
153 }
154 /// Consumes the builder and constructs a [`CreateProfileInput`](crate::operation::create_profile::CreateProfileInput).
155 pub fn build(
156 self,
157 ) -> ::std::result::Result<crate::operation::create_profile::CreateProfileInput, ::aws_smithy_types::error::operation::BuildError> {
158 ::std::result::Result::Ok(crate::operation::create_profile::CreateProfileInput {
159 as2_id: self.as2_id,
160 profile_type: self.profile_type,
161 certificate_ids: self.certificate_ids,
162 tags: self.tags,
163 })
164 }
165}