aws_sdk_managedblockchain/types/
_remove_action.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>An action to remove a member from a Managed Blockchain network as the result of a removal proposal that is <code>APPROVED</code>. The member and all associated resources are deleted from the network.</p>
4/// <p>Applies only to Hyperledger Fabric.</p>
5#[non_exhaustive]
6#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
7pub struct RemoveAction {
8    /// <p>The unique identifier of the member to remove.</p>
9    pub member_id: ::std::string::String,
10}
11impl RemoveAction {
12    /// <p>The unique identifier of the member to remove.</p>
13    pub fn member_id(&self) -> &str {
14        use std::ops::Deref;
15        self.member_id.deref()
16    }
17}
18impl RemoveAction {
19    /// Creates a new builder-style object to manufacture [`RemoveAction`](crate::types::RemoveAction).
20    pub fn builder() -> crate::types::builders::RemoveActionBuilder {
21        crate::types::builders::RemoveActionBuilder::default()
22    }
23}
24
25/// A builder for [`RemoveAction`](crate::types::RemoveAction).
26#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
27#[non_exhaustive]
28pub struct RemoveActionBuilder {
29    pub(crate) member_id: ::std::option::Option<::std::string::String>,
30}
31impl RemoveActionBuilder {
32    /// <p>The unique identifier of the member to remove.</p>
33    /// This field is required.
34    pub fn member_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
35        self.member_id = ::std::option::Option::Some(input.into());
36        self
37    }
38    /// <p>The unique identifier of the member to remove.</p>
39    pub fn set_member_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
40        self.member_id = input;
41        self
42    }
43    /// <p>The unique identifier of the member to remove.</p>
44    pub fn get_member_id(&self) -> &::std::option::Option<::std::string::String> {
45        &self.member_id
46    }
47    /// Consumes the builder and constructs a [`RemoveAction`](crate::types::RemoveAction).
48    /// This method will fail if any of the following fields are not set:
49    /// - [`member_id`](crate::types::builders::RemoveActionBuilder::member_id)
50    pub fn build(self) -> ::std::result::Result<crate::types::RemoveAction, ::aws_smithy_types::error::operation::BuildError> {
51        ::std::result::Result::Ok(crate::types::RemoveAction {
52            member_id: self.member_id.ok_or_else(|| {
53                ::aws_smithy_types::error::operation::BuildError::missing_field(
54                    "member_id",
55                    "member_id was not specified but it is required when building RemoveAction",
56                )
57            })?,
58        })
59    }
60}