Skip to main content

aws_sdk_workspaces/types/
_image_permission.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes the Amazon Web Services accounts that have been granted permission to use a shared image. For more information about sharing images, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/share-custom-image.html"> Share or Unshare a Custom WorkSpaces Image</a>.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ImagePermission {
7    /// <p>The identifier of the Amazon Web Services account that an image has been shared with.</p>
8    pub shared_account_id: ::std::option::Option<::std::string::String>,
9}
10impl ImagePermission {
11    /// <p>The identifier of the Amazon Web Services account that an image has been shared with.</p>
12    pub fn shared_account_id(&self) -> ::std::option::Option<&str> {
13        self.shared_account_id.as_deref()
14    }
15}
16impl ImagePermission {
17    /// Creates a new builder-style object to manufacture [`ImagePermission`](crate::types::ImagePermission).
18    pub fn builder() -> crate::types::builders::ImagePermissionBuilder {
19        crate::types::builders::ImagePermissionBuilder::default()
20    }
21}
22
23/// A builder for [`ImagePermission`](crate::types::ImagePermission).
24#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
25#[non_exhaustive]
26pub struct ImagePermissionBuilder {
27    pub(crate) shared_account_id: ::std::option::Option<::std::string::String>,
28}
29impl ImagePermissionBuilder {
30    /// <p>The identifier of the Amazon Web Services account that an image has been shared with.</p>
31    pub fn shared_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
32        self.shared_account_id = ::std::option::Option::Some(input.into());
33        self
34    }
35    /// <p>The identifier of the Amazon Web Services account that an image has been shared with.</p>
36    pub fn set_shared_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
37        self.shared_account_id = input;
38        self
39    }
40    /// <p>The identifier of the Amazon Web Services account that an image has been shared with.</p>
41    pub fn get_shared_account_id(&self) -> &::std::option::Option<::std::string::String> {
42        &self.shared_account_id
43    }
44    /// Consumes the builder and constructs a [`ImagePermission`](crate::types::ImagePermission).
45    pub fn build(self) -> crate::types::ImagePermission {
46        crate::types::ImagePermission {
47            shared_account_id: self.shared_account_id,
48        }
49    }
50}