aws-sdk-context 1.0.0

AWS SDK for AWS Context
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The association between an agent context and a curation policy. The agent context enforces the policy's latest published version.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct AssociateCurationPolicyOutput {
    /// <p>The agent context's ID.</p>
    pub agent_context_id: ::std::string::String,
    /// <p>The ID of the curation policy that is associated with the agent context.</p>
    pub curation_policy_id: ::std::string::String,
    _request_id: Option<String>,
}
impl AssociateCurationPolicyOutput {
    /// <p>The agent context's ID.</p>
    pub fn agent_context_id(&self) -> &str {
        use std::ops::Deref;
        self.agent_context_id.deref()
    }
    /// <p>The ID of the curation policy that is associated with the agent context.</p>
    pub fn curation_policy_id(&self) -> &str {
        use std::ops::Deref;
        self.curation_policy_id.deref()
    }
}
impl ::aws_types::request_id::RequestId for AssociateCurationPolicyOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl AssociateCurationPolicyOutput {
    /// Creates a new builder-style object to manufacture [`AssociateCurationPolicyOutput`](crate::operation::associate_curation_policy::AssociateCurationPolicyOutput).
    pub fn builder() -> crate::operation::associate_curation_policy::builders::AssociateCurationPolicyOutputBuilder {
        crate::operation::associate_curation_policy::builders::AssociateCurationPolicyOutputBuilder::default()
    }
}

/// A builder for [`AssociateCurationPolicyOutput`](crate::operation::associate_curation_policy::AssociateCurationPolicyOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AssociateCurationPolicyOutputBuilder {
    pub(crate) agent_context_id: ::std::option::Option<::std::string::String>,
    pub(crate) curation_policy_id: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl AssociateCurationPolicyOutputBuilder {
    /// <p>The agent context's ID.</p>
    /// This field is required.
    pub fn agent_context_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.agent_context_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The agent context's ID.</p>
    pub fn set_agent_context_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.agent_context_id = input;
        self
    }
    /// <p>The agent context's ID.</p>
    pub fn get_agent_context_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_context_id
    }
    /// <p>The ID of the curation policy that is associated with the agent context.</p>
    /// This field is required.
    pub fn curation_policy_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.curation_policy_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the curation policy that is associated with the agent context.</p>
    pub fn set_curation_policy_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.curation_policy_id = input;
        self
    }
    /// <p>The ID of the curation policy that is associated with the agent context.</p>
    pub fn get_curation_policy_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.curation_policy_id
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`AssociateCurationPolicyOutput`](crate::operation::associate_curation_policy::AssociateCurationPolicyOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`agent_context_id`](crate::operation::associate_curation_policy::builders::AssociateCurationPolicyOutputBuilder::agent_context_id)
    /// - [`curation_policy_id`](crate::operation::associate_curation_policy::builders::AssociateCurationPolicyOutputBuilder::curation_policy_id)
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::associate_curation_policy::AssociateCurationPolicyOutput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::associate_curation_policy::AssociateCurationPolicyOutput {
            agent_context_id: self.agent_context_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "agent_context_id",
                    "agent_context_id was not specified but it is required when building AssociateCurationPolicyOutput",
                )
            })?,
            curation_policy_id: self.curation_policy_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "curation_policy_id",
                    "curation_policy_id was not specified but it is required when building AssociateCurationPolicyOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}