aws_sdk_s3/types/
_grant.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Container for grant information.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Grant {
7    /// <p>The person being granted permissions.</p>
8    pub grantee: ::std::option::Option<crate::types::Grantee>,
9    /// <p>Specifies the permission given to the grantee.</p>
10    pub permission: ::std::option::Option<crate::types::Permission>,
11}
12impl Grant {
13    /// <p>The person being granted permissions.</p>
14    pub fn grantee(&self) -> ::std::option::Option<&crate::types::Grantee> {
15        self.grantee.as_ref()
16    }
17    /// <p>Specifies the permission given to the grantee.</p>
18    pub fn permission(&self) -> ::std::option::Option<&crate::types::Permission> {
19        self.permission.as_ref()
20    }
21}
22impl Grant {
23    /// Creates a new builder-style object to manufacture [`Grant`](crate::types::Grant).
24    pub fn builder() -> crate::types::builders::GrantBuilder {
25        crate::types::builders::GrantBuilder::default()
26    }
27}
28
29/// A builder for [`Grant`](crate::types::Grant).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct GrantBuilder {
33    pub(crate) grantee: ::std::option::Option<crate::types::Grantee>,
34    pub(crate) permission: ::std::option::Option<crate::types::Permission>,
35}
36impl GrantBuilder {
37    /// <p>The person being granted permissions.</p>
38    pub fn grantee(mut self, input: crate::types::Grantee) -> Self {
39        self.grantee = ::std::option::Option::Some(input);
40        self
41    }
42    /// <p>The person being granted permissions.</p>
43    pub fn set_grantee(mut self, input: ::std::option::Option<crate::types::Grantee>) -> Self {
44        self.grantee = input;
45        self
46    }
47    /// <p>The person being granted permissions.</p>
48    pub fn get_grantee(&self) -> &::std::option::Option<crate::types::Grantee> {
49        &self.grantee
50    }
51    /// <p>Specifies the permission given to the grantee.</p>
52    pub fn permission(mut self, input: crate::types::Permission) -> Self {
53        self.permission = ::std::option::Option::Some(input);
54        self
55    }
56    /// <p>Specifies the permission given to the grantee.</p>
57    pub fn set_permission(mut self, input: ::std::option::Option<crate::types::Permission>) -> Self {
58        self.permission = input;
59        self
60    }
61    /// <p>Specifies the permission given to the grantee.</p>
62    pub fn get_permission(&self) -> &::std::option::Option<crate::types::Permission> {
63        &self.permission
64    }
65    /// Consumes the builder and constructs a [`Grant`](crate::types::Grant).
66    pub fn build(self) -> crate::types::Grant {
67        crate::types::Grant {
68            grantee: self.grantee,
69            permission: self.permission,
70        }
71    }
72}