aws_sdk_s3/types/
_grant.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Container for grant information.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Grant {
    /// <p>The person being granted permissions.</p>
    pub grantee: ::std::option::Option<crate::types::Grantee>,
    /// <p>Specifies the permission given to the grantee.</p>
    pub permission: ::std::option::Option<crate::types::Permission>,
}
impl Grant {
    /// <p>The person being granted permissions.</p>
    pub fn grantee(&self) -> ::std::option::Option<&crate::types::Grantee> {
        self.grantee.as_ref()
    }
    /// <p>Specifies the permission given to the grantee.</p>
    pub fn permission(&self) -> ::std::option::Option<&crate::types::Permission> {
        self.permission.as_ref()
    }
}
impl Grant {
    /// Creates a new builder-style object to manufacture [`Grant`](crate::types::Grant).
    pub fn builder() -> crate::types::builders::GrantBuilder {
        crate::types::builders::GrantBuilder::default()
    }
}

/// A builder for [`Grant`](crate::types::Grant).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GrantBuilder {
    pub(crate) grantee: ::std::option::Option<crate::types::Grantee>,
    pub(crate) permission: ::std::option::Option<crate::types::Permission>,
}
impl GrantBuilder {
    /// <p>The person being granted permissions.</p>
    pub fn grantee(mut self, input: crate::types::Grantee) -> Self {
        self.grantee = ::std::option::Option::Some(input);
        self
    }
    /// <p>The person being granted permissions.</p>
    pub fn set_grantee(mut self, input: ::std::option::Option<crate::types::Grantee>) -> Self {
        self.grantee = input;
        self
    }
    /// <p>The person being granted permissions.</p>
    pub fn get_grantee(&self) -> &::std::option::Option<crate::types::Grantee> {
        &self.grantee
    }
    /// <p>Specifies the permission given to the grantee.</p>
    pub fn permission(mut self, input: crate::types::Permission) -> Self {
        self.permission = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies the permission given to the grantee.</p>
    pub fn set_permission(mut self, input: ::std::option::Option<crate::types::Permission>) -> Self {
        self.permission = input;
        self
    }
    /// <p>Specifies the permission given to the grantee.</p>
    pub fn get_permission(&self) -> &::std::option::Option<crate::types::Permission> {
        &self.permission
    }
    /// Consumes the builder and constructs a [`Grant`](crate::types::Grant).
    pub fn build(self) -> crate::types::Grant {
        crate::types::Grant {
            grantee: self.grantee,
            permission: self.permission,
        }
    }
}