aws-sdk-novaact 1.6.0

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

/// <p>A request for the client to execute a specific tool with given parameters.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Call {
    /// <p>A unique identifier for this tool call, used to match results back to requests.</p>
    pub call_id: ::std::string::String,
    /// <p>The input parameters for the tool call, formatted according to the tool's schema.</p>
    pub input: ::aws_smithy_types::Document,
    /// <p>The name of the tool to invoke, following the pattern 'tool.{toolName}' or 'browser.{browserAction}'.</p>
    pub name: ::std::string::String,
}
impl Call {
    /// <p>A unique identifier for this tool call, used to match results back to requests.</p>
    pub fn call_id(&self) -> &str {
        use std::ops::Deref;
        self.call_id.deref()
    }
    /// <p>The input parameters for the tool call, formatted according to the tool's schema.</p>
    pub fn input(&self) -> &::aws_smithy_types::Document {
        &self.input
    }
    /// <p>The name of the tool to invoke, following the pattern 'tool.{toolName}' or 'browser.{browserAction}'.</p>
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
}
impl ::std::fmt::Debug for Call {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("Call");
        formatter.field("call_id", &self.call_id);
        formatter.field("input", &"*** Sensitive Data Redacted ***");
        formatter.field("name", &self.name);
        formatter.finish()
    }
}
impl Call {
    /// Creates a new builder-style object to manufacture [`Call`](crate::types::Call).
    pub fn builder() -> crate::types::builders::CallBuilder {
        crate::types::builders::CallBuilder::default()
    }
}

/// A builder for [`Call`](crate::types::Call).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CallBuilder {
    pub(crate) call_id: ::std::option::Option<::std::string::String>,
    pub(crate) input: ::std::option::Option<::aws_smithy_types::Document>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
}
impl CallBuilder {
    /// <p>A unique identifier for this tool call, used to match results back to requests.</p>
    /// This field is required.
    pub fn call_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.call_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique identifier for this tool call, used to match results back to requests.</p>
    pub fn set_call_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.call_id = input;
        self
    }
    /// <p>A unique identifier for this tool call, used to match results back to requests.</p>
    pub fn get_call_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.call_id
    }
    /// <p>The input parameters for the tool call, formatted according to the tool's schema.</p>
    /// This field is required.
    pub fn input(mut self, input: ::aws_smithy_types::Document) -> Self {
        self.input = ::std::option::Option::Some(input);
        self
    }
    /// <p>The input parameters for the tool call, formatted according to the tool's schema.</p>
    pub fn set_input(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
        self.input = input;
        self
    }
    /// <p>The input parameters for the tool call, formatted according to the tool's schema.</p>
    pub fn get_input(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
        &self.input
    }
    /// <p>The name of the tool to invoke, following the pattern 'tool.{toolName}' or 'browser.{browserAction}'.</p>
    /// 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
    }
    /// <p>The name of the tool to invoke, following the pattern 'tool.{toolName}' or 'browser.{browserAction}'.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the tool to invoke, following the pattern 'tool.{toolName}' or 'browser.{browserAction}'.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// Consumes the builder and constructs a [`Call`](crate::types::Call).
    /// This method will fail if any of the following fields are not set:
    /// - [`call_id`](crate::types::builders::CallBuilder::call_id)
    /// - [`input`](crate::types::builders::CallBuilder::input)
    /// - [`name`](crate::types::builders::CallBuilder::name)
    pub fn build(self) -> ::std::result::Result<crate::types::Call, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Call {
            call_id: self.call_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "call_id",
                    "call_id was not specified but it is required when building Call",
                )
            })?,
            input: self.input.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "input",
                    "input was not specified but it is required when building Call",
                )
            })?,
            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 Call",
                )
            })?,
        })
    }
}
impl ::std::fmt::Debug for CallBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CallBuilder");
        formatter.field("call_id", &self.call_id);
        formatter.field("input", &"*** Sensitive Data Redacted ***");
        formatter.field("name", &self.name);
        formatter.finish()
    }
}