aws_sdk_omics/operation/create_share/
_create_share_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 CreateShareInput {
6    /// <p>The ARN of the resource to be shared.</p>
7    pub resource_arn: ::std::option::Option<::std::string::String>,
8    /// <p>The principal subscriber is the account being offered shared access to the resource.</p>
9    pub principal_subscriber: ::std::option::Option<::std::string::String>,
10    /// <p>A name that the owner defines for the share.</p>
11    pub share_name: ::std::option::Option<::std::string::String>,
12}
13impl CreateShareInput {
14    /// <p>The ARN of the resource to be shared.</p>
15    pub fn resource_arn(&self) -> ::std::option::Option<&str> {
16        self.resource_arn.as_deref()
17    }
18    /// <p>The principal subscriber is the account being offered shared access to the resource.</p>
19    pub fn principal_subscriber(&self) -> ::std::option::Option<&str> {
20        self.principal_subscriber.as_deref()
21    }
22    /// <p>A name that the owner defines for the share.</p>
23    pub fn share_name(&self) -> ::std::option::Option<&str> {
24        self.share_name.as_deref()
25    }
26}
27impl CreateShareInput {
28    /// Creates a new builder-style object to manufacture [`CreateShareInput`](crate::operation::create_share::CreateShareInput).
29    pub fn builder() -> crate::operation::create_share::builders::CreateShareInputBuilder {
30        crate::operation::create_share::builders::CreateShareInputBuilder::default()
31    }
32}
33
34/// A builder for [`CreateShareInput`](crate::operation::create_share::CreateShareInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct CreateShareInputBuilder {
38    pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
39    pub(crate) principal_subscriber: ::std::option::Option<::std::string::String>,
40    pub(crate) share_name: ::std::option::Option<::std::string::String>,
41}
42impl CreateShareInputBuilder {
43    /// <p>The ARN of the resource to be shared.</p>
44    /// This field is required.
45    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46        self.resource_arn = ::std::option::Option::Some(input.into());
47        self
48    }
49    /// <p>The ARN of the resource to be shared.</p>
50    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51        self.resource_arn = input;
52        self
53    }
54    /// <p>The ARN of the resource to be shared.</p>
55    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
56        &self.resource_arn
57    }
58    /// <p>The principal subscriber is the account being offered shared access to the resource.</p>
59    /// This field is required.
60    pub fn principal_subscriber(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.principal_subscriber = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>The principal subscriber is the account being offered shared access to the resource.</p>
65    pub fn set_principal_subscriber(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.principal_subscriber = input;
67        self
68    }
69    /// <p>The principal subscriber is the account being offered shared access to the resource.</p>
70    pub fn get_principal_subscriber(&self) -> &::std::option::Option<::std::string::String> {
71        &self.principal_subscriber
72    }
73    /// <p>A name that the owner defines for the share.</p>
74    pub fn share_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.share_name = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>A name that the owner defines for the share.</p>
79    pub fn set_share_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.share_name = input;
81        self
82    }
83    /// <p>A name that the owner defines for the share.</p>
84    pub fn get_share_name(&self) -> &::std::option::Option<::std::string::String> {
85        &self.share_name
86    }
87    /// Consumes the builder and constructs a [`CreateShareInput`](crate::operation::create_share::CreateShareInput).
88    pub fn build(self) -> ::std::result::Result<crate::operation::create_share::CreateShareInput, ::aws_smithy_types::error::operation::BuildError> {
89        ::std::result::Result::Ok(crate::operation::create_share::CreateShareInput {
90            resource_arn: self.resource_arn,
91            principal_subscriber: self.principal_subscriber,
92            share_name: self.share_name,
93        })
94    }
95}