aws-sdk-wellarchitected 1.79.0

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

/// <p>A choice available to answer question.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Choice {
    /// <p>The ID of a choice.</p>
    pub choice_id: ::std::option::Option<::std::string::String>,
    /// <p>The title of a choice.</p>
    pub title: ::std::option::Option<::std::string::String>,
    /// <p>The description of a choice.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The helpful resource (both text and URL) for a particular choice.</p>
    /// <p>This field only applies to custom lenses. Each choice can have only one helpful resource.</p>
    pub helpful_resource: ::std::option::Option<crate::types::ChoiceContent>,
    /// <p>The improvement plan (both text and URL) for a particular choice.</p>
    /// <p>This field only applies to custom lenses. Each choice can have only one improvement plan.</p>
    pub improvement_plan: ::std::option::Option<crate::types::ChoiceContent>,
    /// <p>The additional resources for a choice in a custom lens.</p>
    /// <p>A choice can have up to two additional resources: one of type <code>HELPFUL_RESOURCE</code>, one of type <code>IMPROVEMENT_PLAN</code>, or both.</p>
    pub additional_resources: ::std::option::Option<::std::vec::Vec<crate::types::AdditionalResources>>,
}
impl Choice {
    /// <p>The ID of a choice.</p>
    pub fn choice_id(&self) -> ::std::option::Option<&str> {
        self.choice_id.as_deref()
    }
    /// <p>The title of a choice.</p>
    pub fn title(&self) -> ::std::option::Option<&str> {
        self.title.as_deref()
    }
    /// <p>The description of a choice.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The helpful resource (both text and URL) for a particular choice.</p>
    /// <p>This field only applies to custom lenses. Each choice can have only one helpful resource.</p>
    pub fn helpful_resource(&self) -> ::std::option::Option<&crate::types::ChoiceContent> {
        self.helpful_resource.as_ref()
    }
    /// <p>The improvement plan (both text and URL) for a particular choice.</p>
    /// <p>This field only applies to custom lenses. Each choice can have only one improvement plan.</p>
    pub fn improvement_plan(&self) -> ::std::option::Option<&crate::types::ChoiceContent> {
        self.improvement_plan.as_ref()
    }
    /// <p>The additional resources for a choice in a custom lens.</p>
    /// <p>A choice can have up to two additional resources: one of type <code>HELPFUL_RESOURCE</code>, one of type <code>IMPROVEMENT_PLAN</code>, or both.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.additional_resources.is_none()`.
    pub fn additional_resources(&self) -> &[crate::types::AdditionalResources] {
        self.additional_resources.as_deref().unwrap_or_default()
    }
}
impl Choice {
    /// Creates a new builder-style object to manufacture [`Choice`](crate::types::Choice).
    pub fn builder() -> crate::types::builders::ChoiceBuilder {
        crate::types::builders::ChoiceBuilder::default()
    }
}

/// A builder for [`Choice`](crate::types::Choice).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ChoiceBuilder {
    pub(crate) choice_id: ::std::option::Option<::std::string::String>,
    pub(crate) title: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) helpful_resource: ::std::option::Option<crate::types::ChoiceContent>,
    pub(crate) improvement_plan: ::std::option::Option<crate::types::ChoiceContent>,
    pub(crate) additional_resources: ::std::option::Option<::std::vec::Vec<crate::types::AdditionalResources>>,
}
impl ChoiceBuilder {
    /// <p>The ID of a choice.</p>
    pub fn choice_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.choice_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of a choice.</p>
    pub fn set_choice_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.choice_id = input;
        self
    }
    /// <p>The ID of a choice.</p>
    pub fn get_choice_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.choice_id
    }
    /// <p>The title of a choice.</p>
    pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.title = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The title of a choice.</p>
    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.title = input;
        self
    }
    /// <p>The title of a choice.</p>
    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
        &self.title
    }
    /// <p>The description of a choice.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description of a choice.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The description of a choice.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The helpful resource (both text and URL) for a particular choice.</p>
    /// <p>This field only applies to custom lenses. Each choice can have only one helpful resource.</p>
    pub fn helpful_resource(mut self, input: crate::types::ChoiceContent) -> Self {
        self.helpful_resource = ::std::option::Option::Some(input);
        self
    }
    /// <p>The helpful resource (both text and URL) for a particular choice.</p>
    /// <p>This field only applies to custom lenses. Each choice can have only one helpful resource.</p>
    pub fn set_helpful_resource(mut self, input: ::std::option::Option<crate::types::ChoiceContent>) -> Self {
        self.helpful_resource = input;
        self
    }
    /// <p>The helpful resource (both text and URL) for a particular choice.</p>
    /// <p>This field only applies to custom lenses. Each choice can have only one helpful resource.</p>
    pub fn get_helpful_resource(&self) -> &::std::option::Option<crate::types::ChoiceContent> {
        &self.helpful_resource
    }
    /// <p>The improvement plan (both text and URL) for a particular choice.</p>
    /// <p>This field only applies to custom lenses. Each choice can have only one improvement plan.</p>
    pub fn improvement_plan(mut self, input: crate::types::ChoiceContent) -> Self {
        self.improvement_plan = ::std::option::Option::Some(input);
        self
    }
    /// <p>The improvement plan (both text and URL) for a particular choice.</p>
    /// <p>This field only applies to custom lenses. Each choice can have only one improvement plan.</p>
    pub fn set_improvement_plan(mut self, input: ::std::option::Option<crate::types::ChoiceContent>) -> Self {
        self.improvement_plan = input;
        self
    }
    /// <p>The improvement plan (both text and URL) for a particular choice.</p>
    /// <p>This field only applies to custom lenses. Each choice can have only one improvement plan.</p>
    pub fn get_improvement_plan(&self) -> &::std::option::Option<crate::types::ChoiceContent> {
        &self.improvement_plan
    }
    /// Appends an item to `additional_resources`.
    ///
    /// To override the contents of this collection use [`set_additional_resources`](Self::set_additional_resources).
    ///
    /// <p>The additional resources for a choice in a custom lens.</p>
    /// <p>A choice can have up to two additional resources: one of type <code>HELPFUL_RESOURCE</code>, one of type <code>IMPROVEMENT_PLAN</code>, or both.</p>
    pub fn additional_resources(mut self, input: crate::types::AdditionalResources) -> Self {
        let mut v = self.additional_resources.unwrap_or_default();
        v.push(input);
        self.additional_resources = ::std::option::Option::Some(v);
        self
    }
    /// <p>The additional resources for a choice in a custom lens.</p>
    /// <p>A choice can have up to two additional resources: one of type <code>HELPFUL_RESOURCE</code>, one of type <code>IMPROVEMENT_PLAN</code>, or both.</p>
    pub fn set_additional_resources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AdditionalResources>>) -> Self {
        self.additional_resources = input;
        self
    }
    /// <p>The additional resources for a choice in a custom lens.</p>
    /// <p>A choice can have up to two additional resources: one of type <code>HELPFUL_RESOURCE</code>, one of type <code>IMPROVEMENT_PLAN</code>, or both.</p>
    pub fn get_additional_resources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AdditionalResources>> {
        &self.additional_resources
    }
    /// Consumes the builder and constructs a [`Choice`](crate::types::Choice).
    pub fn build(self) -> crate::types::Choice {
        crate::types::Choice {
            choice_id: self.choice_id,
            title: self.title,
            description: self.description,
            helpful_resource: self.helpful_resource,
            improvement_plan: self.improvement_plan,
            additional_resources: self.additional_resources,
        }
    }
}