aws-sdk-cloudwatchomni 1.2.0

AWS SDK for CloudWatch Omni
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateViewOutput {
    /// The name of the view.
    pub name: ::std::string::String,
    /// The ownership category of the view.
    pub r#type: crate::types::ViewType,
    /// The description of the view.
    pub description: ::std::option::Option<::std::string::String>,
    /// The SQL query that defines the view.
    pub definition: ::std::string::String,
    /// The timestamp when the view was created.
    pub created_at: ::aws_smithy_types::DateTime,
    /// The timestamp when the view was last updated.
    pub updated_at: ::aws_smithy_types::DateTime,
    /// The ARN of the view.
    pub arn: ::std::string::String,
    _request_id: Option<String>,
}
impl UpdateViewOutput {
    /// The name of the view.
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
    /// The ownership category of the view.
    pub fn r#type(&self) -> &crate::types::ViewType {
        &self.r#type
    }
    /// The description of the view.
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// The SQL query that defines the view.
    pub fn definition(&self) -> &str {
        use std::ops::Deref;
        self.definition.deref()
    }
    /// The timestamp when the view was created.
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// The timestamp when the view was last updated.
    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
        &self.updated_at
    }
    /// The ARN of the view.
    pub fn arn(&self) -> &str {
        use std::ops::Deref;
        self.arn.deref()
    }
}
impl ::aws_types::request_id::RequestId for UpdateViewOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl UpdateViewOutput {
    /// Creates a new builder-style object to manufacture [`UpdateViewOutput`](crate::operation::update_view::UpdateViewOutput).
    pub fn builder() -> crate::operation::update_view::builders::UpdateViewOutputBuilder {
        crate::operation::update_view::builders::UpdateViewOutputBuilder::default()
    }
}

/// A builder for [`UpdateViewOutput`](crate::operation::update_view::UpdateViewOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateViewOutputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) r#type: ::std::option::Option<crate::types::ViewType>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) definition: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl UpdateViewOutputBuilder {
    /// The name of the view.
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// The name of the view.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// The name of the view.
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// The ownership category of the view.
    /// This field is required.
    pub fn r#type(mut self, input: crate::types::ViewType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// The ownership category of the view.
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::ViewType>) -> Self {
        self.r#type = input;
        self
    }
    /// The ownership category of the view.
    pub fn get_type(&self) -> &::std::option::Option<crate::types::ViewType> {
        &self.r#type
    }
    /// The description of the view.
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// The description of the view.
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// The description of the view.
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// The SQL query that defines the view.
    /// This field is required.
    pub fn definition(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.definition = ::std::option::Option::Some(input.into());
        self
    }
    /// The SQL query that defines the view.
    pub fn set_definition(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.definition = input;
        self
    }
    /// The SQL query that defines the view.
    pub fn get_definition(&self) -> &::std::option::Option<::std::string::String> {
        &self.definition
    }
    /// The timestamp when the view was created.
    /// This field is required.
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// The timestamp when the view was created.
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// The timestamp when the view was created.
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// The timestamp when the view was last updated.
    /// This field is required.
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// The timestamp when the view was last updated.
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// The timestamp when the view was last updated.
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// The ARN of the view.
    /// This field is required.
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The ARN of the view.
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// The ARN of the view.
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    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 [`UpdateViewOutput`](crate::operation::update_view::UpdateViewOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`name`](crate::operation::update_view::builders::UpdateViewOutputBuilder::name)
    /// - [`r#type`](crate::operation::update_view::builders::UpdateViewOutputBuilder::type)
    /// - [`definition`](crate::operation::update_view::builders::UpdateViewOutputBuilder::definition)
    /// - [`created_at`](crate::operation::update_view::builders::UpdateViewOutputBuilder::created_at)
    /// - [`updated_at`](crate::operation::update_view::builders::UpdateViewOutputBuilder::updated_at)
    /// - [`arn`](crate::operation::update_view::builders::UpdateViewOutputBuilder::arn)
    pub fn build(self) -> ::std::result::Result<crate::operation::update_view::UpdateViewOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_view::UpdateViewOutput {
            name: self.name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "name",
                    "name was not specified but it is required when building UpdateViewOutput",
                )
            })?,
            r#type: self.r#type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "r#type",
                    "r#type was not specified but it is required when building UpdateViewOutput",
                )
            })?,
            description: self.description,
            definition: self.definition.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "definition",
                    "definition was not specified but it is required when building UpdateViewOutput",
                )
            })?,
            created_at: self.created_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "created_at",
                    "created_at was not specified but it is required when building UpdateViewOutput",
                )
            })?,
            updated_at: self.updated_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "updated_at",
                    "updated_at was not specified but it is required when building UpdateViewOutput",
                )
            })?,
            arn: self.arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "arn",
                    "arn was not specified but it is required when building UpdateViewOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}