aws_sdk_kms/operation/create_grant/
_create_grant_output.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 CreateGrantOutput {
6    /// <p>The grant token.</p>
7    /// <p>Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved <i>eventual consistency</i>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token">Grant token</a> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token">Using a grant token</a> in the <i>Key Management Service Developer Guide</i>.</p>
8    pub grant_token: ::std::option::Option<::std::string::String>,
9    /// <p>The unique identifier for the grant.</p>
10    /// <p>You can use the <code>GrantId</code> in a <code>ListGrants</code>, <code>RetireGrant</code>, or <code>RevokeGrant</code> operation.</p>
11    pub grant_id: ::std::option::Option<::std::string::String>,
12    _request_id: Option<String>,
13}
14impl CreateGrantOutput {
15    /// <p>The grant token.</p>
16    /// <p>Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved <i>eventual consistency</i>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token">Grant token</a> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token">Using a grant token</a> in the <i>Key Management Service Developer Guide</i>.</p>
17    pub fn grant_token(&self) -> ::std::option::Option<&str> {
18        self.grant_token.as_deref()
19    }
20    /// <p>The unique identifier for the grant.</p>
21    /// <p>You can use the <code>GrantId</code> in a <code>ListGrants</code>, <code>RetireGrant</code>, or <code>RevokeGrant</code> operation.</p>
22    pub fn grant_id(&self) -> ::std::option::Option<&str> {
23        self.grant_id.as_deref()
24    }
25}
26impl ::aws_types::request_id::RequestId for CreateGrantOutput {
27    fn request_id(&self) -> Option<&str> {
28        self._request_id.as_deref()
29    }
30}
31impl CreateGrantOutput {
32    /// Creates a new builder-style object to manufacture [`CreateGrantOutput`](crate::operation::create_grant::CreateGrantOutput).
33    pub fn builder() -> crate::operation::create_grant::builders::CreateGrantOutputBuilder {
34        crate::operation::create_grant::builders::CreateGrantOutputBuilder::default()
35    }
36}
37
38/// A builder for [`CreateGrantOutput`](crate::operation::create_grant::CreateGrantOutput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct CreateGrantOutputBuilder {
42    pub(crate) grant_token: ::std::option::Option<::std::string::String>,
43    pub(crate) grant_id: ::std::option::Option<::std::string::String>,
44    _request_id: Option<String>,
45}
46impl CreateGrantOutputBuilder {
47    /// <p>The grant token.</p>
48    /// <p>Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved <i>eventual consistency</i>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token">Grant token</a> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token">Using a grant token</a> in the <i>Key Management Service Developer Guide</i>.</p>
49    pub fn grant_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
50        self.grant_token = ::std::option::Option::Some(input.into());
51        self
52    }
53    /// <p>The grant token.</p>
54    /// <p>Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved <i>eventual consistency</i>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token">Grant token</a> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token">Using a grant token</a> in the <i>Key Management Service Developer Guide</i>.</p>
55    pub fn set_grant_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
56        self.grant_token = input;
57        self
58    }
59    /// <p>The grant token.</p>
60    /// <p>Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved <i>eventual consistency</i>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token">Grant token</a> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token">Using a grant token</a> in the <i>Key Management Service Developer Guide</i>.</p>
61    pub fn get_grant_token(&self) -> &::std::option::Option<::std::string::String> {
62        &self.grant_token
63    }
64    /// <p>The unique identifier for the grant.</p>
65    /// <p>You can use the <code>GrantId</code> in a <code>ListGrants</code>, <code>RetireGrant</code>, or <code>RevokeGrant</code> operation.</p>
66    pub fn grant_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.grant_id = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The unique identifier for the grant.</p>
71    /// <p>You can use the <code>GrantId</code> in a <code>ListGrants</code>, <code>RetireGrant</code>, or <code>RevokeGrant</code> operation.</p>
72    pub fn set_grant_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.grant_id = input;
74        self
75    }
76    /// <p>The unique identifier for the grant.</p>
77    /// <p>You can use the <code>GrantId</code> in a <code>ListGrants</code>, <code>RetireGrant</code>, or <code>RevokeGrant</code> operation.</p>
78    pub fn get_grant_id(&self) -> &::std::option::Option<::std::string::String> {
79        &self.grant_id
80    }
81    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
82        self._request_id = Some(request_id.into());
83        self
84    }
85
86    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
87        self._request_id = request_id;
88        self
89    }
90    /// Consumes the builder and constructs a [`CreateGrantOutput`](crate::operation::create_grant::CreateGrantOutput).
91    pub fn build(self) -> crate::operation::create_grant::CreateGrantOutput {
92        crate::operation::create_grant::CreateGrantOutput {
93            grant_token: self.grant_token,
94            grant_id: self.grant_id,
95            _request_id: self._request_id,
96        }
97    }
98}