aws-sdk-assurance 1.0.0

AWS SDK for AWS Assurance
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::fmt::Debug)]
pub struct ChatOutput {
    /// <p>The stream of chat events returned by the agent.</p>
    pub event_stream: crate::event_receiver::EventReceiver<crate::types::ChatEventStream, crate::types::error::ChatEventStreamError>,
    /// <p>The ID of the session. If you omitted <code>sessionId</code> in the request, use this value to continue the session in subsequent calls.</p>
    pub session_id: ::std::string::String,
    /// <p>The updated sequence number for this session. Pass this value as <code>expectedSequenceNumber</code> on your next call.</p>
    pub sequence_number: i64,
    _request_id: Option<String>,
}
impl ChatOutput {
    /// <p>The stream of chat events returned by the agent.</p>
    pub fn event_stream(&self) -> &crate::event_receiver::EventReceiver<crate::types::ChatEventStream, crate::types::error::ChatEventStreamError> {
        &self.event_stream
    }
    /// <p>The ID of the session. If you omitted <code>sessionId</code> in the request, use this value to continue the session in subsequent calls.</p>
    pub fn session_id(&self) -> &str {
        use std::ops::Deref;
        self.session_id.deref()
    }
    /// <p>The updated sequence number for this session. Pass this value as <code>expectedSequenceNumber</code> on your next call.</p>
    pub fn sequence_number(&self) -> i64 {
        self.sequence_number
    }
}
impl ::aws_types::request_id::RequestId for ChatOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl ChatOutput {
    /// Creates a new builder-style object to manufacture [`ChatOutput`](crate::operation::chat::ChatOutput).
    pub fn builder() -> crate::operation::chat::builders::ChatOutputBuilder {
        crate::operation::chat::builders::ChatOutputBuilder::default()
    }
    #[allow(unused)]
    pub(crate) fn into_builder(self) -> crate::operation::chat::builders::ChatOutputBuilder {
        Self::builder()
            .event_stream(self.event_stream)
            .session_id(self.session_id)
            .sequence_number(self.sequence_number)
    }
}

/// A builder for [`ChatOutput`](crate::operation::chat::ChatOutput).
#[derive(::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ChatOutputBuilder {
    pub(crate) event_stream:
        ::std::option::Option<crate::event_receiver::EventReceiver<crate::types::ChatEventStream, crate::types::error::ChatEventStreamError>>,
    pub(crate) session_id: ::std::option::Option<::std::string::String>,
    pub(crate) sequence_number: ::std::option::Option<i64>,
    _request_id: Option<String>,
}
impl ChatOutputBuilder {
    /// <p>The stream of chat events returned by the agent.</p>
    /// This field is required.
    pub fn event_stream(
        mut self,
        input: crate::event_receiver::EventReceiver<crate::types::ChatEventStream, crate::types::error::ChatEventStreamError>,
    ) -> Self {
        self.event_stream = ::std::option::Option::Some(input);
        self
    }
    /// <p>The stream of chat events returned by the agent.</p>
    pub fn set_event_stream(
        mut self,
        input: ::std::option::Option<crate::event_receiver::EventReceiver<crate::types::ChatEventStream, crate::types::error::ChatEventStreamError>>,
    ) -> Self {
        self.event_stream = input;
        self
    }
    /// <p>The stream of chat events returned by the agent.</p>
    pub fn get_event_stream(
        &self,
    ) -> &::std::option::Option<crate::event_receiver::EventReceiver<crate::types::ChatEventStream, crate::types::error::ChatEventStreamError>> {
        &self.event_stream
    }
    /// <p>The ID of the session. If you omitted <code>sessionId</code> in the request, use this value to continue the session in subsequent calls.</p>
    /// This field is required.
    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.session_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the session. If you omitted <code>sessionId</code> in the request, use this value to continue the session in subsequent calls.</p>
    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.session_id = input;
        self
    }
    /// <p>The ID of the session. If you omitted <code>sessionId</code> in the request, use this value to continue the session in subsequent calls.</p>
    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.session_id
    }
    /// <p>The updated sequence number for this session. Pass this value as <code>expectedSequenceNumber</code> on your next call.</p>
    /// This field is required.
    pub fn sequence_number(mut self, input: i64) -> Self {
        self.sequence_number = ::std::option::Option::Some(input);
        self
    }
    /// <p>The updated sequence number for this session. Pass this value as <code>expectedSequenceNumber</code> on your next call.</p>
    pub fn set_sequence_number(mut self, input: ::std::option::Option<i64>) -> Self {
        self.sequence_number = input;
        self
    }
    /// <p>The updated sequence number for this session. Pass this value as <code>expectedSequenceNumber</code> on your next call.</p>
    pub fn get_sequence_number(&self) -> &::std::option::Option<i64> {
        &self.sequence_number
    }
    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 [`ChatOutput`](crate::operation::chat::ChatOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`event_stream`](crate::operation::chat::builders::ChatOutputBuilder::event_stream)
    /// - [`session_id`](crate::operation::chat::builders::ChatOutputBuilder::session_id)
    /// - [`sequence_number`](crate::operation::chat::builders::ChatOutputBuilder::sequence_number)
    pub fn build(self) -> ::std::result::Result<crate::operation::chat::ChatOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::chat::ChatOutput {
            event_stream: self.event_stream.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "event_stream",
                    "event_stream was not specified but it is required when building ChatOutput",
                )
            })?,
            session_id: self.session_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "session_id",
                    "session_id was not specified but it is required when building ChatOutput",
                )
            })?,
            sequence_number: self.sequence_number.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "sequence_number",
                    "sequence_number was not specified but it is required when building ChatOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}