// 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 InvokeModelWithBidirectionalStreamInput {
    /// <p>The model ID or ARN of the model ID to use. Currently, only <code>amazon.nova-sonic-v1:0</code> is supported.</p>
    pub model_id: ::std::option::Option<::std::string::String>,
    /// <p>The prompt and inference parameters in the format specified in the <code>BidirectionalInputPayloadPart</code> in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
    pub body: ::aws_smithy_http::event_stream::EventStreamSender<
        crate::types::InvokeModelWithBidirectionalStreamInput,
        crate::types::error::InvokeModelWithBidirectionalStreamInputError,
    >,
}
impl InvokeModelWithBidirectionalStreamInput {
    /// <p>The model ID or ARN of the model ID to use. Currently, only <code>amazon.nova-sonic-v1:0</code> is supported.</p>
    pub fn model_id(&self) -> ::std::option::Option<&str> {
        self.model_id.as_deref()
    }
    /// <p>The prompt and inference parameters in the format specified in the <code>BidirectionalInputPayloadPart</code> in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
    pub fn body(
        &self,
    ) -> &::aws_smithy_http::event_stream::EventStreamSender<
        crate::types::InvokeModelWithBidirectionalStreamInput,
        crate::types::error::InvokeModelWithBidirectionalStreamInputError,
    > {
        &self.body
    }
}
impl InvokeModelWithBidirectionalStreamInput {
    /// Creates a new builder-style object to manufacture [`InvokeModelWithBidirectionalStreamInput`](crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamInput).
    pub fn builder() -> crate::operation::invoke_model_with_bidirectional_stream::builders::InvokeModelWithBidirectionalStreamInputBuilder {
        crate::operation::invoke_model_with_bidirectional_stream::builders::InvokeModelWithBidirectionalStreamInputBuilder::default()
    }
}

/// A builder for [`InvokeModelWithBidirectionalStreamInput`](crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamInput).
#[derive(::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct InvokeModelWithBidirectionalStreamInputBuilder {
    pub(crate) model_id: ::std::option::Option<::std::string::String>,
    pub(crate) body: ::std::option::Option<
        ::aws_smithy_http::event_stream::EventStreamSender<
            crate::types::InvokeModelWithBidirectionalStreamInput,
            crate::types::error::InvokeModelWithBidirectionalStreamInputError,
        >,
    >,
}
impl InvokeModelWithBidirectionalStreamInputBuilder {
    /// <p>The model ID or ARN of the model ID to use. Currently, only <code>amazon.nova-sonic-v1:0</code> is supported.</p>
    /// This field is required.
    pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.model_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The model ID or ARN of the model ID to use. Currently, only <code>amazon.nova-sonic-v1:0</code> is supported.</p>
    pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.model_id = input;
        self
    }
    /// <p>The model ID or ARN of the model ID to use. Currently, only <code>amazon.nova-sonic-v1:0</code> is supported.</p>
    pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.model_id
    }
    /// <p>The prompt and inference parameters in the format specified in the <code>BidirectionalInputPayloadPart</code> in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
    /// This field is required.
    pub fn body(
        mut self,
        input: ::aws_smithy_http::event_stream::EventStreamSender<
            crate::types::InvokeModelWithBidirectionalStreamInput,
            crate::types::error::InvokeModelWithBidirectionalStreamInputError,
        >,
    ) -> Self {
        self.body = ::std::option::Option::Some(input);
        self
    }
    /// <p>The prompt and inference parameters in the format specified in the <code>BidirectionalInputPayloadPart</code> in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
    pub fn set_body(
        mut self,
        input: ::std::option::Option<
            ::aws_smithy_http::event_stream::EventStreamSender<
                crate::types::InvokeModelWithBidirectionalStreamInput,
                crate::types::error::InvokeModelWithBidirectionalStreamInputError,
            >,
        >,
    ) -> Self {
        self.body = input;
        self
    }
    /// <p>The prompt and inference parameters in the format specified in the <code>BidirectionalInputPayloadPart</code> in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
    pub fn get_body(
        &self,
    ) -> &::std::option::Option<
        ::aws_smithy_http::event_stream::EventStreamSender<
            crate::types::InvokeModelWithBidirectionalStreamInput,
            crate::types::error::InvokeModelWithBidirectionalStreamInputError,
        >,
    > {
        &self.body
    }
    /// Consumes the builder and constructs a [`InvokeModelWithBidirectionalStreamInput`](crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamInput).
    /// This method will fail if any of the following fields are not set:
    /// - [`body`](crate::operation::invoke_model_with_bidirectional_stream::builders::InvokeModelWithBidirectionalStreamInputBuilder::body)
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(
            crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamInput {
                model_id: self.model_id,
                body: self.body.ok_or_else(|| {
                    ::aws_smithy_types::error::operation::BuildError::missing_field(
                        "body",
                        "body was not specified but it is required when building InvokeModelWithBidirectionalStreamInput",
                    )
                })?,
            },
        )
    }
}
