aws_sdk_eventbridge/operation/remove_permission/
_remove_permission_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 RemovePermissionInput {
6    /// <p>The statement ID corresponding to the account that is no longer allowed to put events to the default event bus.</p>
7    pub statement_id: ::std::option::Option<::std::string::String>,
8    /// <p>Specifies whether to remove all permissions.</p>
9    pub remove_all_permissions: ::std::option::Option<bool>,
10    /// <p>The name of the event bus to revoke permissions for. If you omit this, the default event bus is used.</p>
11    pub event_bus_name: ::std::option::Option<::std::string::String>,
12}
13impl RemovePermissionInput {
14    /// <p>The statement ID corresponding to the account that is no longer allowed to put events to the default event bus.</p>
15    pub fn statement_id(&self) -> ::std::option::Option<&str> {
16        self.statement_id.as_deref()
17    }
18    /// <p>Specifies whether to remove all permissions.</p>
19    pub fn remove_all_permissions(&self) -> ::std::option::Option<bool> {
20        self.remove_all_permissions
21    }
22    /// <p>The name of the event bus to revoke permissions for. If you omit this, the default event bus is used.</p>
23    pub fn event_bus_name(&self) -> ::std::option::Option<&str> {
24        self.event_bus_name.as_deref()
25    }
26}
27impl RemovePermissionInput {
28    /// Creates a new builder-style object to manufacture [`RemovePermissionInput`](crate::operation::remove_permission::RemovePermissionInput).
29    pub fn builder() -> crate::operation::remove_permission::builders::RemovePermissionInputBuilder {
30        crate::operation::remove_permission::builders::RemovePermissionInputBuilder::default()
31    }
32}
33
34/// A builder for [`RemovePermissionInput`](crate::operation::remove_permission::RemovePermissionInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct RemovePermissionInputBuilder {
38    pub(crate) statement_id: ::std::option::Option<::std::string::String>,
39    pub(crate) remove_all_permissions: ::std::option::Option<bool>,
40    pub(crate) event_bus_name: ::std::option::Option<::std::string::String>,
41}
42impl RemovePermissionInputBuilder {
43    /// <p>The statement ID corresponding to the account that is no longer allowed to put events to the default event bus.</p>
44    pub fn statement_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
45        self.statement_id = ::std::option::Option::Some(input.into());
46        self
47    }
48    /// <p>The statement ID corresponding to the account that is no longer allowed to put events to the default event bus.</p>
49    pub fn set_statement_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
50        self.statement_id = input;
51        self
52    }
53    /// <p>The statement ID corresponding to the account that is no longer allowed to put events to the default event bus.</p>
54    pub fn get_statement_id(&self) -> &::std::option::Option<::std::string::String> {
55        &self.statement_id
56    }
57    /// <p>Specifies whether to remove all permissions.</p>
58    pub fn remove_all_permissions(mut self, input: bool) -> Self {
59        self.remove_all_permissions = ::std::option::Option::Some(input);
60        self
61    }
62    /// <p>Specifies whether to remove all permissions.</p>
63    pub fn set_remove_all_permissions(mut self, input: ::std::option::Option<bool>) -> Self {
64        self.remove_all_permissions = input;
65        self
66    }
67    /// <p>Specifies whether to remove all permissions.</p>
68    pub fn get_remove_all_permissions(&self) -> &::std::option::Option<bool> {
69        &self.remove_all_permissions
70    }
71    /// <p>The name of the event bus to revoke permissions for. If you omit this, the default event bus is used.</p>
72    pub fn event_bus_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73        self.event_bus_name = ::std::option::Option::Some(input.into());
74        self
75    }
76    /// <p>The name of the event bus to revoke permissions for. If you omit this, the default event bus is used.</p>
77    pub fn set_event_bus_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
78        self.event_bus_name = input;
79        self
80    }
81    /// <p>The name of the event bus to revoke permissions for. If you omit this, the default event bus is used.</p>
82    pub fn get_event_bus_name(&self) -> &::std::option::Option<::std::string::String> {
83        &self.event_bus_name
84    }
85    /// Consumes the builder and constructs a [`RemovePermissionInput`](crate::operation::remove_permission::RemovePermissionInput).
86    pub fn build(
87        self,
88    ) -> ::std::result::Result<crate::operation::remove_permission::RemovePermissionInput, ::aws_smithy_types::error::operation::BuildError> {
89        ::std::result::Result::Ok(crate::operation::remove_permission::RemovePermissionInput {
90            statement_id: self.statement_id,
91            remove_all_permissions: self.remove_all_permissions,
92            event_bus_name: self.event_bus_name,
93        })
94    }
95}