aws_sdk_grafana/operation/update_permissions/
_update_permissions_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 UpdatePermissionsInput {
6    /// <p>An array of structures that contain the permission updates to make.</p>
7    pub update_instruction_batch: ::std::option::Option<::std::vec::Vec<crate::types::UpdateInstruction>>,
8    /// <p>The ID of the workspace to update.</p>
9    pub workspace_id: ::std::option::Option<::std::string::String>,
10}
11impl UpdatePermissionsInput {
12    /// <p>An array of structures that contain the permission updates to make.</p>
13    ///
14    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.update_instruction_batch.is_none()`.
15    pub fn update_instruction_batch(&self) -> &[crate::types::UpdateInstruction] {
16        self.update_instruction_batch.as_deref().unwrap_or_default()
17    }
18    /// <p>The ID of the workspace to update.</p>
19    pub fn workspace_id(&self) -> ::std::option::Option<&str> {
20        self.workspace_id.as_deref()
21    }
22}
23impl UpdatePermissionsInput {
24    /// Creates a new builder-style object to manufacture [`UpdatePermissionsInput`](crate::operation::update_permissions::UpdatePermissionsInput).
25    pub fn builder() -> crate::operation::update_permissions::builders::UpdatePermissionsInputBuilder {
26        crate::operation::update_permissions::builders::UpdatePermissionsInputBuilder::default()
27    }
28}
29
30/// A builder for [`UpdatePermissionsInput`](crate::operation::update_permissions::UpdatePermissionsInput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct UpdatePermissionsInputBuilder {
34    pub(crate) update_instruction_batch: ::std::option::Option<::std::vec::Vec<crate::types::UpdateInstruction>>,
35    pub(crate) workspace_id: ::std::option::Option<::std::string::String>,
36}
37impl UpdatePermissionsInputBuilder {
38    /// Appends an item to `update_instruction_batch`.
39    ///
40    /// To override the contents of this collection use [`set_update_instruction_batch`](Self::set_update_instruction_batch).
41    ///
42    /// <p>An array of structures that contain the permission updates to make.</p>
43    pub fn update_instruction_batch(mut self, input: crate::types::UpdateInstruction) -> Self {
44        let mut v = self.update_instruction_batch.unwrap_or_default();
45        v.push(input);
46        self.update_instruction_batch = ::std::option::Option::Some(v);
47        self
48    }
49    /// <p>An array of structures that contain the permission updates to make.</p>
50    pub fn set_update_instruction_batch(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::UpdateInstruction>>) -> Self {
51        self.update_instruction_batch = input;
52        self
53    }
54    /// <p>An array of structures that contain the permission updates to make.</p>
55    pub fn get_update_instruction_batch(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::UpdateInstruction>> {
56        &self.update_instruction_batch
57    }
58    /// <p>The ID of the workspace to update.</p>
59    /// This field is required.
60    pub fn workspace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.workspace_id = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>The ID of the workspace to update.</p>
65    pub fn set_workspace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.workspace_id = input;
67        self
68    }
69    /// <p>The ID of the workspace to update.</p>
70    pub fn get_workspace_id(&self) -> &::std::option::Option<::std::string::String> {
71        &self.workspace_id
72    }
73    /// Consumes the builder and constructs a [`UpdatePermissionsInput`](crate::operation::update_permissions::UpdatePermissionsInput).
74    pub fn build(
75        self,
76    ) -> ::std::result::Result<crate::operation::update_permissions::UpdatePermissionsInput, ::aws_smithy_types::error::operation::BuildError> {
77        ::std::result::Result::Ok(crate::operation::update_permissions::UpdatePermissionsInput {
78            update_instruction_batch: self.update_instruction_batch,
79            workspace_id: self.workspace_id,
80        })
81    }
82}