#![allow(rustdoc::bare_urls)]
#![allow(rustdoc::broken_intra_doc_links)]
#![allow(rustdoc::invalid_html_tags)]
#![allow(rustdoc::redundant_explicit_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_cloud_gax;
extern crate google_cloud_location;
extern crate google_cloud_longrunning;
extern crate google_cloud_lro;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Agent {
pub name: std::string::String,
pub display_name: std::string::String,
pub description: std::string::String,
pub model_settings: std::option::Option<crate::model::ModelSettings>,
pub instruction: std::string::String,
pub tools: std::vec::Vec<std::string::String>,
pub child_agents: std::vec::Vec<std::string::String>,
pub before_agent_callbacks: std::vec::Vec<crate::model::Callback>,
pub after_agent_callbacks: std::vec::Vec<crate::model::Callback>,
pub before_model_callbacks: std::vec::Vec<crate::model::Callback>,
pub after_model_callbacks: std::vec::Vec<crate::model::Callback>,
pub before_tool_callbacks: std::vec::Vec<crate::model::Callback>,
pub after_tool_callbacks: std::vec::Vec<crate::model::Callback>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub guardrails: std::vec::Vec<std::string::String>,
pub etag: std::string::String,
pub toolsets: std::vec::Vec<crate::model::agent::AgentToolset>,
pub generated_summary: std::string::String,
pub transfer_rules: std::vec::Vec<crate::model::TransferRule>,
pub validation_errors: std::vec::Vec<std::string::String>,
pub agent_type: std::option::Option<crate::model::agent::AgentType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Agent {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_model_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ModelSettings>,
{
self.model_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_model_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ModelSettings>,
{
self.model_settings = v.map(|x| x.into());
self
}
pub fn set_instruction<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instruction = v.into();
self
}
pub fn set_tools<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.tools = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_child_agents<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.child_agents = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_before_agent_callbacks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Callback>,
{
use std::iter::Iterator;
self.before_agent_callbacks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_after_agent_callbacks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Callback>,
{
use std::iter::Iterator;
self.after_agent_callbacks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_before_model_callbacks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Callback>,
{
use std::iter::Iterator;
self.before_model_callbacks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_after_model_callbacks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Callback>,
{
use std::iter::Iterator;
self.after_model_callbacks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_before_tool_callbacks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Callback>,
{
use std::iter::Iterator;
self.before_tool_callbacks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_after_tool_callbacks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Callback>,
{
use std::iter::Iterator;
self.after_tool_callbacks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_guardrails<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.guardrails = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_toolsets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::agent::AgentToolset>,
{
use std::iter::Iterator;
self.toolsets = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_generated_summary<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.generated_summary = v.into();
self
}
pub fn set_transfer_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TransferRule>,
{
use std::iter::Iterator;
self.transfer_rules = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_validation_errors<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.validation_errors = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_agent_type<
T: std::convert::Into<std::option::Option<crate::model::agent::AgentType>>,
>(
mut self,
v: T,
) -> Self {
self.agent_type = v.into();
self
}
pub fn llm_agent(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::agent::LlmAgent>> {
#[allow(unreachable_patterns)]
self.agent_type.as_ref().and_then(|v| match v {
crate::model::agent::AgentType::LlmAgent(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_llm_agent<T: std::convert::Into<std::boxed::Box<crate::model::agent::LlmAgent>>>(
mut self,
v: T,
) -> Self {
self.agent_type =
std::option::Option::Some(crate::model::agent::AgentType::LlmAgent(v.into()));
self
}
pub fn remote_dialogflow_agent(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::agent::RemoteDialogflowAgent>> {
#[allow(unreachable_patterns)]
self.agent_type.as_ref().and_then(|v| match v {
crate::model::agent::AgentType::RemoteDialogflowAgent(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_remote_dialogflow_agent<
T: std::convert::Into<std::boxed::Box<crate::model::agent::RemoteDialogflowAgent>>,
>(
mut self,
v: T,
) -> Self {
self.agent_type = std::option::Option::Some(
crate::model::agent::AgentType::RemoteDialogflowAgent(v.into()),
);
self
}
}
impl wkt::message::Message for Agent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Agent"
}
}
pub mod agent {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LlmAgent {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LlmAgent {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for LlmAgent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Agent.LlmAgent"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RemoteDialogflowAgent {
pub agent: std::string::String,
pub flow_id: std::string::String,
pub environment_id: std::string::String,
pub input_variable_mapping:
std::collections::HashMap<std::string::String, std::string::String>,
pub output_variable_mapping:
std::collections::HashMap<std::string::String, std::string::String>,
pub respect_response_interruption_settings: bool,
pub language_code_variable: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RemoteDialogflowAgent {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_agent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.agent = v.into();
self
}
pub fn set_flow_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.flow_id = v.into();
self
}
pub fn set_environment_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.environment_id = v.into();
self
}
pub fn set_input_variable_mapping<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.input_variable_mapping =
v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_output_variable_mapping<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.output_variable_mapping =
v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_respect_response_interruption_settings<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.respect_response_interruption_settings = v.into();
self
}
pub fn set_language_code_variable<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.language_code_variable = v.into();
self
}
}
impl wkt::message::Message for RemoteDialogflowAgent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Agent.RemoteDialogflowAgent"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AgentToolset {
pub toolset: std::string::String,
pub tool_ids: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AgentToolset {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_toolset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.toolset = v.into();
self
}
pub fn set_tool_ids<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.tool_ids = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AgentToolset {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Agent.AgentToolset"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AgentType {
LlmAgent(std::boxed::Box<crate::model::agent::LlmAgent>),
RemoteDialogflowAgent(std::boxed::Box<crate::model::agent::RemoteDialogflowAgent>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AgentCard {
pub name: std::string::String,
pub description: std::string::String,
pub supported_interfaces: std::vec::Vec<crate::model::AgentInterface>,
pub version: std::string::String,
pub skills: std::vec::Vec<crate::model::AgentSkill>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AgentCard {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_supported_interfaces<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AgentInterface>,
{
use std::iter::Iterator;
self.supported_interfaces = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
pub fn set_skills<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AgentSkill>,
{
use std::iter::Iterator;
self.skills = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AgentCard {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.AgentCard"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AgentInterface {
pub url: std::string::String,
pub protocol_binding: std::string::String,
pub tenant: std::string::String,
pub protocol_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AgentInterface {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.url = v.into();
self
}
pub fn set_protocol_binding<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.protocol_binding = v.into();
self
}
pub fn set_tenant<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tenant = v.into();
self
}
pub fn set_protocol_version<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.protocol_version = v.into();
self
}
}
impl wkt::message::Message for AgentInterface {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.AgentInterface"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AgentSkill {
pub id: std::string::String,
pub name: std::string::String,
pub description: std::string::String,
pub tags: std::vec::Vec<std::string::String>,
pub examples: std::vec::Vec<std::string::String>,
pub input_modes: std::vec::Vec<std::string::String>,
pub output_modes: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AgentSkill {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_tags<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.tags = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_examples<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.examples = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_input_modes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.input_modes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_output_modes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.output_modes = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AgentSkill {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.AgentSkill"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RemoteAgentTool {
pub name: std::string::String,
pub description: std::string::String,
pub agent_card: std::option::Option<crate::model::AgentCard>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RemoteAgentTool {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_agent_card<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AgentCard>,
{
self.agent_card = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_agent_card<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AgentCard>,
{
self.agent_card = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RemoteAgentTool {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.RemoteAgentTool"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAppsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAppsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListAppsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ListAppsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAppsResponse {
pub apps: std::vec::Vec<crate::model::App>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAppsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_apps<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::App>,
{
use std::iter::Iterator;
self.apps = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListAppsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ListAppsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListAppsResponse {
type PageItem = crate::model::App;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.apps
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetAppRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetAppRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetAppRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.GetAppRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateAppRequest {
pub parent: std::string::String,
pub app_id: std::string::String,
pub app: std::option::Option<crate::model::App>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateAppRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_app_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.app_id = v.into();
self
}
pub fn set_app<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::App>,
{
self.app = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_app<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::App>,
{
self.app = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateAppRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.CreateAppRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateAppRequest {
pub app: std::option::Option<crate::model::App>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateAppRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_app<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::App>,
{
self.app = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_app<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::App>,
{
self.app = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateAppRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.UpdateAppRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteAppRequest {
pub name: std::string::String,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteAppRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteAppRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DeleteAppRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportAppRequest {
pub name: std::string::String,
pub export_format: crate::model::export_app_request::ExportFormat,
pub gcs_uri: std::string::String,
pub app_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExportAppRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_export_format<
T: std::convert::Into<crate::model::export_app_request::ExportFormat>,
>(
mut self,
v: T,
) -> Self {
self.export_format = v.into();
self
}
pub fn set_gcs_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.gcs_uri = v.into();
self
}
pub fn set_app_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.app_version = v.into();
self
}
}
impl wkt::message::Message for ExportAppRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ExportAppRequest"
}
}
pub mod export_app_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ExportFormat {
Unspecified,
Json,
Yaml,
UnknownValue(export_format::UnknownValue),
}
#[doc(hidden)]
pub mod export_format {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ExportFormat {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Json => std::option::Option::Some(1),
Self::Yaml => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("EXPORT_FORMAT_UNSPECIFIED"),
Self::Json => std::option::Option::Some("JSON"),
Self::Yaml => std::option::Option::Some("YAML"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ExportFormat {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ExportFormat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ExportFormat {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Json,
2 => Self::Yaml,
_ => Self::UnknownValue(export_format::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ExportFormat {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EXPORT_FORMAT_UNSPECIFIED" => Self::Unspecified,
"JSON" => Self::Json,
"YAML" => Self::Yaml,
_ => Self::UnknownValue(export_format::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ExportFormat {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Json => serializer.serialize_i32(1),
Self::Yaml => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ExportFormat {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExportFormat>::new(
".google.cloud.ces.v1.ExportAppRequest.ExportFormat",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportAppResponse {
pub app: std::option::Option<crate::model::export_app_response::App>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExportAppResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_app<
T: std::convert::Into<std::option::Option<crate::model::export_app_response::App>>,
>(
mut self,
v: T,
) -> Self {
self.app = v.into();
self
}
pub fn app_content(&self) -> std::option::Option<&::bytes::Bytes> {
#[allow(unreachable_patterns)]
self.app.as_ref().and_then(|v| match v {
crate::model::export_app_response::App::AppContent(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_app_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.app =
std::option::Option::Some(crate::model::export_app_response::App::AppContent(v.into()));
self
}
pub fn app_uri(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.app.as_ref().and_then(|v| match v {
crate::model::export_app_response::App::AppUri(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_app_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.app =
std::option::Option::Some(crate::model::export_app_response::App::AppUri(v.into()));
self
}
}
impl wkt::message::Message for ExportAppResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ExportAppResponse"
}
}
pub mod export_app_response {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum App {
AppContent(::bytes::Bytes),
AppUri(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportAppRequest {
pub parent: std::string::String,
pub display_name: std::string::String,
pub app_id: std::string::String,
pub import_options: std::option::Option<crate::model::import_app_request::ImportOptions>,
pub ignore_app_lock: bool,
pub app: std::option::Option<crate::model::import_app_request::App>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImportAppRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_app_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.app_id = v.into();
self
}
pub fn set_import_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::import_app_request::ImportOptions>,
{
self.import_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_import_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::import_app_request::ImportOptions>,
{
self.import_options = v.map(|x| x.into());
self
}
pub fn set_ignore_app_lock<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ignore_app_lock = v.into();
self
}
pub fn set_app<
T: std::convert::Into<std::option::Option<crate::model::import_app_request::App>>,
>(
mut self,
v: T,
) -> Self {
self.app = v.into();
self
}
pub fn gcs_uri(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.app.as_ref().and_then(|v| match v {
crate::model::import_app_request::App::GcsUri(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_gcs_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.app =
std::option::Option::Some(crate::model::import_app_request::App::GcsUri(v.into()));
self
}
pub fn app_content(&self) -> std::option::Option<&::bytes::Bytes> {
#[allow(unreachable_patterns)]
self.app.as_ref().and_then(|v| match v {
crate::model::import_app_request::App::AppContent(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_app_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.app =
std::option::Option::Some(crate::model::import_app_request::App::AppContent(v.into()));
self
}
}
impl wkt::message::Message for ImportAppRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ImportAppRequest"
}
}
pub mod import_app_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportOptions {
pub conflict_resolution_strategy:
crate::model::import_app_request::import_options::ConflictResolutionStrategy,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImportOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_conflict_resolution_strategy<
T: std::convert::Into<
crate::model::import_app_request::import_options::ConflictResolutionStrategy,
>,
>(
mut self,
v: T,
) -> Self {
self.conflict_resolution_strategy = v.into();
self
}
}
impl wkt::message::Message for ImportOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ImportAppRequest.ImportOptions"
}
}
pub mod import_options {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ConflictResolutionStrategy {
Unspecified,
Replace,
Overwrite,
UnknownValue(conflict_resolution_strategy::UnknownValue),
}
#[doc(hidden)]
pub mod conflict_resolution_strategy {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ConflictResolutionStrategy {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Replace => std::option::Option::Some(1),
Self::Overwrite => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED")
}
Self::Replace => std::option::Option::Some("REPLACE"),
Self::Overwrite => std::option::Option::Some("OVERWRITE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ConflictResolutionStrategy {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ConflictResolutionStrategy {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ConflictResolutionStrategy {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Replace,
2 => Self::Overwrite,
_ => Self::UnknownValue(conflict_resolution_strategy::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ConflictResolutionStrategy {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
"REPLACE" => Self::Replace,
"OVERWRITE" => Self::Overwrite,
_ => Self::UnknownValue(conflict_resolution_strategy::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ConflictResolutionStrategy {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Replace => serializer.serialize_i32(1),
Self::Overwrite => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ConflictResolutionStrategy {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConflictResolutionStrategy>::new(
".google.cloud.ces.v1.ImportAppRequest.ImportOptions.ConflictResolutionStrategy"))
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum App {
GcsUri(std::string::String),
AppContent(::bytes::Bytes),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportAppResponse {
pub name: std::string::String,
pub warnings: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImportAppResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_warnings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.warnings = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ImportAppResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ImportAppResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAgentsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAgentsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListAgentsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ListAgentsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAgentsResponse {
pub agents: std::vec::Vec<crate::model::Agent>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAgentsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_agents<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Agent>,
{
use std::iter::Iterator;
self.agents = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListAgentsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ListAgentsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListAgentsResponse {
type PageItem = crate::model::Agent;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.agents
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetAgentRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetAgentRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetAgentRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.GetAgentRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateAgentRequest {
pub parent: std::string::String,
pub agent_id: std::string::String,
pub agent: std::option::Option<crate::model::Agent>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateAgentRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_agent_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.agent_id = v.into();
self
}
pub fn set_agent<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Agent>,
{
self.agent = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_agent<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Agent>,
{
self.agent = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateAgentRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.CreateAgentRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateAgentRequest {
pub agent: std::option::Option<crate::model::Agent>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateAgentRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_agent<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Agent>,
{
self.agent = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_agent<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Agent>,
{
self.agent = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateAgentRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.UpdateAgentRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteAgentRequest {
pub name: std::string::String,
pub force: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteAgentRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.force = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteAgentRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DeleteAgentRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationMetadata {
pub create_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub status_message: std::string::String,
pub requested_cancellation: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OperationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.status_message = v.into();
self
}
pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.requested_cancellation = v.into();
self
}
}
impl wkt::message::Message for OperationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.OperationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListExamplesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListExamplesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListExamplesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ListExamplesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListExamplesResponse {
pub examples: std::vec::Vec<crate::model::Example>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListExamplesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_examples<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Example>,
{
use std::iter::Iterator;
self.examples = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListExamplesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ListExamplesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListExamplesResponse {
type PageItem = crate::model::Example;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.examples
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetExampleRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetExampleRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetExampleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.GetExampleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateExampleRequest {
pub parent: std::string::String,
pub example_id: std::string::String,
pub example: std::option::Option<crate::model::Example>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateExampleRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_example_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.example_id = v.into();
self
}
pub fn set_example<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Example>,
{
self.example = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_example<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Example>,
{
self.example = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateExampleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.CreateExampleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateExampleRequest {
pub example: std::option::Option<crate::model::Example>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateExampleRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_example<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Example>,
{
self.example = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_example<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Example>,
{
self.example = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateExampleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.UpdateExampleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteExampleRequest {
pub name: std::string::String,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteExampleRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteExampleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DeleteExampleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListToolsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListToolsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListToolsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ListToolsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListToolsResponse {
pub tools: std::vec::Vec<crate::model::Tool>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListToolsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tools<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Tool>,
{
use std::iter::Iterator;
self.tools = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListToolsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ListToolsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListToolsResponse {
type PageItem = crate::model::Tool;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.tools
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetToolRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetToolRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetToolRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.GetToolRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateToolRequest {
pub parent: std::string::String,
pub tool_id: std::string::String,
pub tool: std::option::Option<crate::model::Tool>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateToolRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_tool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tool_id = v.into();
self
}
pub fn set_tool<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Tool>,
{
self.tool = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tool<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Tool>,
{
self.tool = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateToolRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.CreateToolRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateToolRequest {
pub tool: std::option::Option<crate::model::Tool>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateToolRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tool<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Tool>,
{
self.tool = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tool<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Tool>,
{
self.tool = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateToolRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.UpdateToolRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteToolRequest {
pub name: std::string::String,
pub force: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteToolRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.force = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteToolRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DeleteToolRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListConversationsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub source: crate::model::conversation::Source,
pub sources: std::vec::Vec<crate::model::conversation::Source>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListConversationsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_source<T: std::convert::Into<crate::model::conversation::Source>>(
mut self,
v: T,
) -> Self {
self.source = v.into();
self
}
pub fn set_sources<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::conversation::Source>,
{
use std::iter::Iterator;
self.sources = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListConversationsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ListConversationsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListConversationsResponse {
pub conversations: std::vec::Vec<crate::model::Conversation>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListConversationsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_conversations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Conversation>,
{
use std::iter::Iterator;
self.conversations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListConversationsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ListConversationsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListConversationsResponse {
type PageItem = crate::model::Conversation;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.conversations
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetConversationRequest {
pub name: std::string::String,
#[deprecated]
pub source: crate::model::conversation::Source,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetConversationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
#[deprecated]
pub fn set_source<T: std::convert::Into<crate::model::conversation::Source>>(
mut self,
v: T,
) -> Self {
self.source = v.into();
self
}
}
impl wkt::message::Message for GetConversationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.GetConversationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteConversationRequest {
pub name: std::string::String,
#[deprecated]
pub source: crate::model::conversation::Source,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteConversationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
#[deprecated]
pub fn set_source<T: std::convert::Into<crate::model::conversation::Source>>(
mut self,
v: T,
) -> Self {
self.source = v.into();
self
}
}
impl wkt::message::Message for DeleteConversationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DeleteConversationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BatchDeleteConversationsRequest {
pub parent: std::string::String,
pub conversations: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BatchDeleteConversationsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_conversations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.conversations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for BatchDeleteConversationsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.BatchDeleteConversationsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BatchDeleteConversationsResponse {
pub deleted_conversations: std::vec::Vec<std::string::String>,
pub failed_conversations: std::vec::Vec<std::string::String>,
pub error_messages: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BatchDeleteConversationsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_deleted_conversations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.deleted_conversations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_failed_conversations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.failed_conversations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_error_messages<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.error_messages = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for BatchDeleteConversationsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.BatchDeleteConversationsResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListGuardrailsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListGuardrailsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListGuardrailsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ListGuardrailsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListGuardrailsResponse {
pub guardrails: std::vec::Vec<crate::model::Guardrail>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListGuardrailsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_guardrails<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Guardrail>,
{
use std::iter::Iterator;
self.guardrails = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListGuardrailsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ListGuardrailsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListGuardrailsResponse {
type PageItem = crate::model::Guardrail;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.guardrails
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetGuardrailRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetGuardrailRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetGuardrailRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.GetGuardrailRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateGuardrailRequest {
pub parent: std::string::String,
pub guardrail_id: std::string::String,
pub guardrail: std::option::Option<crate::model::Guardrail>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateGuardrailRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_guardrail_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.guardrail_id = v.into();
self
}
pub fn set_guardrail<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Guardrail>,
{
self.guardrail = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_guardrail<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Guardrail>,
{
self.guardrail = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateGuardrailRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.CreateGuardrailRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateGuardrailRequest {
pub guardrail: std::option::Option<crate::model::Guardrail>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateGuardrailRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_guardrail<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Guardrail>,
{
self.guardrail = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_guardrail<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Guardrail>,
{
self.guardrail = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateGuardrailRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.UpdateGuardrailRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteGuardrailRequest {
pub name: std::string::String,
pub force: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteGuardrailRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.force = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteGuardrailRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DeleteGuardrailRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDeploymentsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDeploymentsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListDeploymentsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ListDeploymentsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDeploymentsResponse {
pub deployments: std::vec::Vec<crate::model::Deployment>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDeploymentsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_deployments<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Deployment>,
{
use std::iter::Iterator;
self.deployments = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListDeploymentsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ListDeploymentsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListDeploymentsResponse {
type PageItem = crate::model::Deployment;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.deployments
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDeploymentRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetDeploymentRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetDeploymentRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.GetDeploymentRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateDeploymentRequest {
pub parent: std::string::String,
pub deployment_id: std::string::String,
pub deployment: std::option::Option<crate::model::Deployment>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateDeploymentRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_deployment_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.deployment_id = v.into();
self
}
pub fn set_deployment<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Deployment>,
{
self.deployment = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Deployment>,
{
self.deployment = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateDeploymentRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.CreateDeploymentRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateDeploymentRequest {
pub deployment: std::option::Option<crate::model::Deployment>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateDeploymentRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_deployment<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Deployment>,
{
self.deployment = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Deployment>,
{
self.deployment = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateDeploymentRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.UpdateDeploymentRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDeploymentRequest {
pub name: std::string::String,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteDeploymentRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteDeploymentRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DeleteDeploymentRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListToolsetsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListToolsetsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListToolsetsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ListToolsetsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListToolsetsResponse {
pub toolsets: std::vec::Vec<crate::model::Toolset>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListToolsetsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_toolsets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Toolset>,
{
use std::iter::Iterator;
self.toolsets = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListToolsetsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ListToolsetsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListToolsetsResponse {
type PageItem = crate::model::Toolset;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.toolsets
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetToolsetRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetToolsetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetToolsetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.GetToolsetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateToolsetRequest {
pub parent: std::string::String,
pub toolset_id: std::string::String,
pub toolset: std::option::Option<crate::model::Toolset>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateToolsetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_toolset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.toolset_id = v.into();
self
}
pub fn set_toolset<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Toolset>,
{
self.toolset = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_toolset<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Toolset>,
{
self.toolset = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateToolsetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.CreateToolsetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateToolsetRequest {
pub toolset: std::option::Option<crate::model::Toolset>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateToolsetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_toolset<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Toolset>,
{
self.toolset = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_toolset<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Toolset>,
{
self.toolset = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateToolsetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.UpdateToolsetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteToolsetRequest {
pub name: std::string::String,
pub force: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteToolsetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.force = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteToolsetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DeleteToolsetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAppVersionsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAppVersionsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListAppVersionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ListAppVersionsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAppVersionsResponse {
pub app_versions: std::vec::Vec<crate::model::AppVersion>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAppVersionsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_app_versions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AppVersion>,
{
use std::iter::Iterator;
self.app_versions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListAppVersionsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ListAppVersionsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListAppVersionsResponse {
type PageItem = crate::model::AppVersion;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.app_versions
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetAppVersionRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetAppVersionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetAppVersionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.GetAppVersionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteAppVersionRequest {
pub name: std::string::String,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteAppVersionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteAppVersionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DeleteAppVersionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateAppVersionRequest {
pub parent: std::string::String,
pub app_version_id: std::string::String,
pub app_version: std::option::Option<crate::model::AppVersion>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateAppVersionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_app_version_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.app_version_id = v.into();
self
}
pub fn set_app_version<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AppVersion>,
{
self.app_version = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_app_version<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AppVersion>,
{
self.app_version = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateAppVersionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.CreateAppVersionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RestoreAppVersionRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RestoreAppVersionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for RestoreAppVersionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.RestoreAppVersionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RestoreAppVersionResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RestoreAppVersionResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for RestoreAppVersionResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.RestoreAppVersionResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListChangelogsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListChangelogsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListChangelogsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ListChangelogsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListChangelogsResponse {
pub changelogs: std::vec::Vec<crate::model::Changelog>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListChangelogsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_changelogs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Changelog>,
{
use std::iter::Iterator;
self.changelogs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListChangelogsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ListChangelogsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListChangelogsResponse {
type PageItem = crate::model::Changelog;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.changelogs
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetChangelogRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetChangelogRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetChangelogRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.GetChangelogRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AgentTool {
pub name: std::string::String,
pub description: std::string::String,
pub root_agent: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AgentTool {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_root_agent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.root_agent = v.into();
self
}
}
impl wkt::message::Message for AgentTool {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.AgentTool"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExpressionCondition {
pub expression: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExpressionCondition {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_expression<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.expression = v.into();
self
}
}
impl wkt::message::Message for ExpressionCondition {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ExpressionCondition"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PythonCodeCondition {
pub python_code: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PythonCodeCondition {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_python_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.python_code = v.into();
self
}
}
impl wkt::message::Message for PythonCodeCondition {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.PythonCodeCondition"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TransferRule {
pub child_agent: std::string::String,
pub direction: crate::model::transfer_rule::Direction,
pub rule_type: std::option::Option<crate::model::transfer_rule::RuleType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TransferRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_child_agent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.child_agent = v.into();
self
}
pub fn set_direction<T: std::convert::Into<crate::model::transfer_rule::Direction>>(
mut self,
v: T,
) -> Self {
self.direction = v.into();
self
}
pub fn set_rule_type<
T: std::convert::Into<std::option::Option<crate::model::transfer_rule::RuleType>>,
>(
mut self,
v: T,
) -> Self {
self.rule_type = v.into();
self
}
pub fn deterministic_transfer(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::transfer_rule::DeterministicTransfer>>
{
#[allow(unreachable_patterns)]
self.rule_type.as_ref().and_then(|v| match v {
crate::model::transfer_rule::RuleType::DeterministicTransfer(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_deterministic_transfer<
T: std::convert::Into<std::boxed::Box<crate::model::transfer_rule::DeterministicTransfer>>,
>(
mut self,
v: T,
) -> Self {
self.rule_type = std::option::Option::Some(
crate::model::transfer_rule::RuleType::DeterministicTransfer(v.into()),
);
self
}
pub fn disable_planner_transfer(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::transfer_rule::DisablePlannerTransfer>>
{
#[allow(unreachable_patterns)]
self.rule_type.as_ref().and_then(|v| match v {
crate::model::transfer_rule::RuleType::DisablePlannerTransfer(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_disable_planner_transfer<
T: std::convert::Into<std::boxed::Box<crate::model::transfer_rule::DisablePlannerTransfer>>,
>(
mut self,
v: T,
) -> Self {
self.rule_type = std::option::Option::Some(
crate::model::transfer_rule::RuleType::DisablePlannerTransfer(v.into()),
);
self
}
}
impl wkt::message::Message for TransferRule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.TransferRule"
}
}
pub mod transfer_rule {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeterministicTransfer {
pub condition_type:
std::option::Option<crate::model::transfer_rule::deterministic_transfer::ConditionType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeterministicTransfer {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_condition_type<
T: std::convert::Into<
std::option::Option<
crate::model::transfer_rule::deterministic_transfer::ConditionType,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.condition_type = v.into();
self
}
pub fn expression_condition(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ExpressionCondition>> {
#[allow(unreachable_patterns)]
self.condition_type.as_ref().and_then(|v| match v {
crate::model::transfer_rule::deterministic_transfer::ConditionType::ExpressionCondition(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_expression_condition<
T: std::convert::Into<std::boxed::Box<crate::model::ExpressionCondition>>,
>(
mut self,
v: T,
) -> Self {
self.condition_type = std::option::Option::Some(
crate::model::transfer_rule::deterministic_transfer::ConditionType::ExpressionCondition(
v.into()
)
);
self
}
pub fn python_code_condition(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::PythonCodeCondition>> {
#[allow(unreachable_patterns)]
self.condition_type.as_ref().and_then(|v| match v {
crate::model::transfer_rule::deterministic_transfer::ConditionType::PythonCodeCondition(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_python_code_condition<
T: std::convert::Into<std::boxed::Box<crate::model::PythonCodeCondition>>,
>(
mut self,
v: T,
) -> Self {
self.condition_type = std::option::Option::Some(
crate::model::transfer_rule::deterministic_transfer::ConditionType::PythonCodeCondition(
v.into()
)
);
self
}
}
impl wkt::message::Message for DeterministicTransfer {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.TransferRule.DeterministicTransfer"
}
}
pub mod deterministic_transfer {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ConditionType {
ExpressionCondition(std::boxed::Box<crate::model::ExpressionCondition>),
PythonCodeCondition(std::boxed::Box<crate::model::PythonCodeCondition>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DisablePlannerTransfer {
pub expression_condition: std::option::Option<crate::model::ExpressionCondition>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DisablePlannerTransfer {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_expression_condition<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ExpressionCondition>,
{
self.expression_condition = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_expression_condition<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ExpressionCondition>,
{
self.expression_condition = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DisablePlannerTransfer {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.TransferRule.DisablePlannerTransfer"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Direction {
Unspecified,
ParentToChild,
ChildToParent,
UnknownValue(direction::UnknownValue),
}
#[doc(hidden)]
pub mod direction {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Direction {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ParentToChild => std::option::Option::Some(1),
Self::ChildToParent => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("DIRECTION_UNSPECIFIED"),
Self::ParentToChild => std::option::Option::Some("PARENT_TO_CHILD"),
Self::ChildToParent => std::option::Option::Some("CHILD_TO_PARENT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Direction {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Direction {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Direction {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ParentToChild,
2 => Self::ChildToParent,
_ => Self::UnknownValue(direction::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Direction {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DIRECTION_UNSPECIFIED" => Self::Unspecified,
"PARENT_TO_CHILD" => Self::ParentToChild,
"CHILD_TO_PARENT" => Self::ChildToParent,
_ => Self::UnknownValue(direction::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Direction {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ParentToChild => serializer.serialize_i32(1),
Self::ChildToParent => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Direction {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Direction>::new(
".google.cloud.ces.v1.TransferRule.Direction",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RuleType {
DeterministicTransfer(std::boxed::Box<crate::model::transfer_rule::DeterministicTransfer>),
DisablePlannerTransfer(
std::boxed::Box<crate::model::transfer_rule::DisablePlannerTransfer>,
),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct App {
pub name: std::string::String,
pub display_name: std::string::String,
pub description: std::string::String,
pub pinned: bool,
pub root_agent: std::string::String,
pub language_settings: std::option::Option<crate::model::LanguageSettings>,
pub time_zone_settings: std::option::Option<crate::model::TimeZoneSettings>,
pub audio_processing_config: std::option::Option<crate::model::AudioProcessingConfig>,
pub logging_settings: std::option::Option<crate::model::LoggingSettings>,
pub error_handling_settings: std::option::Option<crate::model::ErrorHandlingSettings>,
pub model_settings: std::option::Option<crate::model::ModelSettings>,
pub tool_execution_mode: crate::model::app::ToolExecutionMode,
pub evaluation_metrics_thresholds:
std::option::Option<crate::model::EvaluationMetricsThresholds>,
pub variable_declarations: std::vec::Vec<crate::model::app::VariableDeclaration>,
pub predefined_variable_declarations: std::vec::Vec<crate::model::app::VariableDeclaration>,
pub global_instruction: std::string::String,
pub guardrails: std::vec::Vec<std::string::String>,
pub data_store_settings: std::option::Option<crate::model::DataStoreSettings>,
pub default_channel_profile: std::option::Option<crate::model::ChannelProfile>,
pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub etag: std::string::String,
pub deployment_count: i32,
pub client_certificate_settings: std::option::Option<crate::model::ClientCertificateSettings>,
pub vpc_sc_settings: std::option::Option<crate::model::VpcScSettings>,
pub locked: bool,
pub validation_errors: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl App {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_pinned<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.pinned = v.into();
self
}
pub fn set_root_agent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.root_agent = v.into();
self
}
pub fn set_language_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LanguageSettings>,
{
self.language_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_language_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LanguageSettings>,
{
self.language_settings = v.map(|x| x.into());
self
}
pub fn set_time_zone_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TimeZoneSettings>,
{
self.time_zone_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_time_zone_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TimeZoneSettings>,
{
self.time_zone_settings = v.map(|x| x.into());
self
}
pub fn set_audio_processing_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AudioProcessingConfig>,
{
self.audio_processing_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_audio_processing_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AudioProcessingConfig>,
{
self.audio_processing_config = v.map(|x| x.into());
self
}
pub fn set_logging_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LoggingSettings>,
{
self.logging_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_logging_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LoggingSettings>,
{
self.logging_settings = v.map(|x| x.into());
self
}
pub fn set_error_handling_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ErrorHandlingSettings>,
{
self.error_handling_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_error_handling_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ErrorHandlingSettings>,
{
self.error_handling_settings = v.map(|x| x.into());
self
}
pub fn set_model_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ModelSettings>,
{
self.model_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_model_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ModelSettings>,
{
self.model_settings = v.map(|x| x.into());
self
}
pub fn set_tool_execution_mode<T: std::convert::Into<crate::model::app::ToolExecutionMode>>(
mut self,
v: T,
) -> Self {
self.tool_execution_mode = v.into();
self
}
pub fn set_evaluation_metrics_thresholds<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EvaluationMetricsThresholds>,
{
self.evaluation_metrics_thresholds = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_evaluation_metrics_thresholds<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::EvaluationMetricsThresholds>,
{
self.evaluation_metrics_thresholds = v.map(|x| x.into());
self
}
pub fn set_variable_declarations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::app::VariableDeclaration>,
{
use std::iter::Iterator;
self.variable_declarations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_predefined_variable_declarations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::app::VariableDeclaration>,
{
use std::iter::Iterator;
self.predefined_variable_declarations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_global_instruction<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.global_instruction = v.into();
self
}
pub fn set_guardrails<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.guardrails = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_data_store_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataStoreSettings>,
{
self.data_store_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_data_store_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataStoreSettings>,
{
self.data_store_settings = v.map(|x| x.into());
self
}
pub fn set_default_channel_profile<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ChannelProfile>,
{
self.default_channel_profile = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_default_channel_profile<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ChannelProfile>,
{
self.default_channel_profile = v.map(|x| x.into());
self
}
pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_deployment_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.deployment_count = v.into();
self
}
pub fn set_client_certificate_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ClientCertificateSettings>,
{
self.client_certificate_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_client_certificate_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ClientCertificateSettings>,
{
self.client_certificate_settings = v.map(|x| x.into());
self
}
pub fn set_vpc_sc_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VpcScSettings>,
{
self.vpc_sc_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_vpc_sc_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VpcScSettings>,
{
self.vpc_sc_settings = v.map(|x| x.into());
self
}
pub fn set_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.locked = v.into();
self
}
pub fn set_validation_errors<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.validation_errors = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for App {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.App"
}
}
pub mod app {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VariableDeclaration {
pub name: std::string::String,
pub description: std::string::String,
pub schema: std::option::Option<crate::model::Schema>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VariableDeclaration {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_schema<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.schema = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_schema<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.schema = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for VariableDeclaration {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.App.VariableDeclaration"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ToolExecutionMode {
Unspecified,
Parallel,
Sequential,
UnknownValue(tool_execution_mode::UnknownValue),
}
#[doc(hidden)]
pub mod tool_execution_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ToolExecutionMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Parallel => std::option::Option::Some(1),
Self::Sequential => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TOOL_EXECUTION_MODE_UNSPECIFIED"),
Self::Parallel => std::option::Option::Some("PARALLEL"),
Self::Sequential => std::option::Option::Some("SEQUENTIAL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ToolExecutionMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ToolExecutionMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ToolExecutionMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Parallel,
2 => Self::Sequential,
_ => Self::UnknownValue(tool_execution_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ToolExecutionMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TOOL_EXECUTION_MODE_UNSPECIFIED" => Self::Unspecified,
"PARALLEL" => Self::Parallel,
"SEQUENTIAL" => Self::Sequential,
_ => Self::UnknownValue(tool_execution_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ToolExecutionMode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Parallel => serializer.serialize_i32(1),
Self::Sequential => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ToolExecutionMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ToolExecutionMode>::new(
".google.cloud.ces.v1.App.ToolExecutionMode",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TimeZoneSettings {
pub time_zone: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TimeZoneSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.time_zone = v.into();
self
}
}
impl wkt::message::Message for TimeZoneSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.TimeZoneSettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LanguageSettings {
pub default_language_code: std::string::String,
pub supported_language_codes: std::vec::Vec<std::string::String>,
pub enable_multilingual_support: bool,
#[deprecated]
pub fallback_action: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LanguageSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_default_language_code<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.default_language_code = v.into();
self
}
pub fn set_supported_language_codes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.supported_language_codes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_enable_multilingual_support<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_multilingual_support = v.into();
self
}
#[deprecated]
pub fn set_fallback_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.fallback_action = v.into();
self
}
}
impl wkt::message::Message for LanguageSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.LanguageSettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AudioProcessingConfig {
pub synthesize_speech_configs:
std::collections::HashMap<std::string::String, crate::model::SynthesizeSpeechConfig>,
pub barge_in_config: std::option::Option<crate::model::BargeInConfig>,
pub inactivity_timeout: std::option::Option<wkt::Duration>,
pub ambient_sound_config: std::option::Option<crate::model::AmbientSoundConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AudioProcessingConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_synthesize_speech_configs<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::SynthesizeSpeechConfig>,
{
use std::iter::Iterator;
self.synthesize_speech_configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_barge_in_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BargeInConfig>,
{
self.barge_in_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_barge_in_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BargeInConfig>,
{
self.barge_in_config = v.map(|x| x.into());
self
}
pub fn set_inactivity_timeout<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.inactivity_timeout = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_inactivity_timeout<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.inactivity_timeout = v.map(|x| x.into());
self
}
pub fn set_ambient_sound_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AmbientSoundConfig>,
{
self.ambient_sound_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ambient_sound_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AmbientSoundConfig>,
{
self.ambient_sound_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AudioProcessingConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.AudioProcessingConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AmbientSoundConfig {
pub volume_gain_db: f64,
pub source: std::option::Option<crate::model::ambient_sound_config::Source>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AmbientSoundConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_volume_gain_db<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.volume_gain_db = v.into();
self
}
pub fn set_source<
T: std::convert::Into<std::option::Option<crate::model::ambient_sound_config::Source>>,
>(
mut self,
v: T,
) -> Self {
self.source = v.into();
self
}
#[deprecated]
pub fn prebuilt_ambient_noise(
&self,
) -> std::option::Option<&crate::model::ambient_sound_config::PrebuiltAmbientNoise> {
#[allow(unreachable_patterns)]
self.source.as_ref().and_then(|v| match v {
crate::model::ambient_sound_config::Source::PrebuiltAmbientNoise(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
#[deprecated]
pub fn set_prebuilt_ambient_noise<
T: std::convert::Into<crate::model::ambient_sound_config::PrebuiltAmbientNoise>,
>(
mut self,
v: T,
) -> Self {
self.source = std::option::Option::Some(
crate::model::ambient_sound_config::Source::PrebuiltAmbientNoise(v.into()),
);
self
}
pub fn gcs_uri(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.source.as_ref().and_then(|v| match v {
crate::model::ambient_sound_config::Source::GcsUri(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_gcs_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source =
std::option::Option::Some(crate::model::ambient_sound_config::Source::GcsUri(v.into()));
self
}
pub fn prebuilt_ambient_sound(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.source.as_ref().and_then(|v| match v {
crate::model::ambient_sound_config::Source::PrebuiltAmbientSound(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_prebuilt_ambient_sound<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.source = std::option::Option::Some(
crate::model::ambient_sound_config::Source::PrebuiltAmbientSound(v.into()),
);
self
}
}
impl wkt::message::Message for AmbientSoundConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.AmbientSoundConfig"
}
}
pub mod ambient_sound_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PrebuiltAmbientNoise {
Unspecified,
RetailStore,
ConventionHall,
Outdoor,
UnknownValue(prebuilt_ambient_noise::UnknownValue),
}
#[doc(hidden)]
pub mod prebuilt_ambient_noise {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PrebuiltAmbientNoise {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::RetailStore => std::option::Option::Some(1),
Self::ConventionHall => std::option::Option::Some(2),
Self::Outdoor => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("PREBUILT_AMBIENT_NOISE_UNSPECIFIED")
}
Self::RetailStore => std::option::Option::Some("RETAIL_STORE"),
Self::ConventionHall => std::option::Option::Some("CONVENTION_HALL"),
Self::Outdoor => std::option::Option::Some("OUTDOOR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PrebuiltAmbientNoise {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PrebuiltAmbientNoise {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for PrebuiltAmbientNoise {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::RetailStore,
2 => Self::ConventionHall,
3 => Self::Outdoor,
_ => Self::UnknownValue(prebuilt_ambient_noise::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PrebuiltAmbientNoise {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PREBUILT_AMBIENT_NOISE_UNSPECIFIED" => Self::Unspecified,
"RETAIL_STORE" => Self::RetailStore,
"CONVENTION_HALL" => Self::ConventionHall,
"OUTDOOR" => Self::Outdoor,
_ => Self::UnknownValue(prebuilt_ambient_noise::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PrebuiltAmbientNoise {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::RetailStore => serializer.serialize_i32(1),
Self::ConventionHall => serializer.serialize_i32(2),
Self::Outdoor => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PrebuiltAmbientNoise {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<PrebuiltAmbientNoise>::new(
".google.cloud.ces.v1.AmbientSoundConfig.PrebuiltAmbientNoise",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Source {
#[deprecated]
PrebuiltAmbientNoise(crate::model::ambient_sound_config::PrebuiltAmbientNoise),
GcsUri(std::string::String),
PrebuiltAmbientSound(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BargeInConfig {
#[deprecated]
pub disable_barge_in: bool,
pub barge_in_awareness: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BargeInConfig {
pub fn new() -> Self {
std::default::Default::default()
}
#[deprecated]
pub fn set_disable_barge_in<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disable_barge_in = v.into();
self
}
pub fn set_barge_in_awareness<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.barge_in_awareness = v.into();
self
}
}
impl wkt::message::Message for BargeInConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.BargeInConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SynthesizeSpeechConfig {
pub voice: std::string::String,
pub voice_sample_gcs_uri: std::string::String,
pub speaking_rate: f64,
pub model: std::string::String,
pub instruction: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SynthesizeSpeechConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_voice<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.voice = v.into();
self
}
pub fn set_voice_sample_gcs_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.voice_sample_gcs_uri = v.into();
self
}
pub fn set_speaking_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.speaking_rate = v.into();
self
}
pub fn set_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.model = v.into();
self
}
pub fn set_instruction<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instruction = v.into();
self
}
}
impl wkt::message::Message for SynthesizeSpeechConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.SynthesizeSpeechConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MetricAnalysisSettings {
pub llm_metrics_opted_out: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MetricAnalysisSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_llm_metrics_opted_out<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.llm_metrics_opted_out = v.into();
self
}
}
impl wkt::message::Message for MetricAnalysisSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.MetricAnalysisSettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LoggingSettings {
pub redaction_config: std::option::Option<crate::model::RedactionConfig>,
pub audio_recording_config: std::option::Option<crate::model::AudioRecordingConfig>,
pub unredacted_audio_recording_config: std::option::Option<crate::model::AudioRecordingConfig>,
pub bigquery_export_settings: std::option::Option<crate::model::BigQueryExportSettings>,
pub unredacted_bigquery_export_settings:
std::option::Option<crate::model::BigQueryExportSettings>,
pub cloud_logging_settings: std::option::Option<crate::model::CloudLoggingSettings>,
pub conversation_logging_settings:
std::option::Option<crate::model::ConversationLoggingSettings>,
pub evaluation_audio_recording_config: std::option::Option<crate::model::AudioRecordingConfig>,
pub metric_analysis_settings: std::option::Option<crate::model::MetricAnalysisSettings>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LoggingSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_redaction_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RedactionConfig>,
{
self.redaction_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_redaction_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RedactionConfig>,
{
self.redaction_config = v.map(|x| x.into());
self
}
pub fn set_audio_recording_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AudioRecordingConfig>,
{
self.audio_recording_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_audio_recording_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AudioRecordingConfig>,
{
self.audio_recording_config = v.map(|x| x.into());
self
}
pub fn set_unredacted_audio_recording_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AudioRecordingConfig>,
{
self.unredacted_audio_recording_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_unredacted_audio_recording_config<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::AudioRecordingConfig>,
{
self.unredacted_audio_recording_config = v.map(|x| x.into());
self
}
pub fn set_bigquery_export_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BigQueryExportSettings>,
{
self.bigquery_export_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_bigquery_export_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BigQueryExportSettings>,
{
self.bigquery_export_settings = v.map(|x| x.into());
self
}
pub fn set_unredacted_bigquery_export_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BigQueryExportSettings>,
{
self.unredacted_bigquery_export_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_unredacted_bigquery_export_settings<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::BigQueryExportSettings>,
{
self.unredacted_bigquery_export_settings = v.map(|x| x.into());
self
}
pub fn set_cloud_logging_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CloudLoggingSettings>,
{
self.cloud_logging_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cloud_logging_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CloudLoggingSettings>,
{
self.cloud_logging_settings = v.map(|x| x.into());
self
}
pub fn set_conversation_logging_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ConversationLoggingSettings>,
{
self.conversation_logging_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_conversation_logging_settings<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::ConversationLoggingSettings>,
{
self.conversation_logging_settings = v.map(|x| x.into());
self
}
pub fn set_evaluation_audio_recording_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AudioRecordingConfig>,
{
self.evaluation_audio_recording_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_evaluation_audio_recording_config<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::AudioRecordingConfig>,
{
self.evaluation_audio_recording_config = v.map(|x| x.into());
self
}
pub fn set_metric_analysis_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MetricAnalysisSettings>,
{
self.metric_analysis_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_metric_analysis_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MetricAnalysisSettings>,
{
self.metric_analysis_settings = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for LoggingSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.LoggingSettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ErrorHandlingSettings {
pub error_handling_strategy: crate::model::error_handling_settings::ErrorHandlingStrategy,
pub fallback_response_config:
std::option::Option<crate::model::error_handling_settings::FallbackResponseConfig>,
pub end_session_config:
std::option::Option<crate::model::error_handling_settings::EndSessionConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ErrorHandlingSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_error_handling_strategy<
T: std::convert::Into<crate::model::error_handling_settings::ErrorHandlingStrategy>,
>(
mut self,
v: T,
) -> Self {
self.error_handling_strategy = v.into();
self
}
pub fn set_fallback_response_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::error_handling_settings::FallbackResponseConfig>,
{
self.fallback_response_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_fallback_response_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::error_handling_settings::FallbackResponseConfig>,
{
self.fallback_response_config = v.map(|x| x.into());
self
}
pub fn set_end_session_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::error_handling_settings::EndSessionConfig>,
{
self.end_session_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_session_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::error_handling_settings::EndSessionConfig>,
{
self.end_session_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ErrorHandlingSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ErrorHandlingSettings"
}
}
pub mod error_handling_settings {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FallbackResponseConfig {
pub custom_fallback_messages:
std::collections::HashMap<std::string::String, std::string::String>,
pub max_fallback_attempts: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FallbackResponseConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_custom_fallback_messages<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.custom_fallback_messages =
v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_max_fallback_attempts<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.max_fallback_attempts = v.into();
self
}
}
impl wkt::message::Message for FallbackResponseConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ErrorHandlingSettings.FallbackResponseConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EndSessionConfig {
pub escalate_session: std::option::Option<bool>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EndSessionConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_escalate_session<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.escalate_session = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_escalate_session<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.escalate_session = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for EndSessionConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ErrorHandlingSettings.EndSessionConfig"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ErrorHandlingStrategy {
Unspecified,
None,
FallbackResponse,
EndSession,
UnknownValue(error_handling_strategy::UnknownValue),
}
#[doc(hidden)]
pub mod error_handling_strategy {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ErrorHandlingStrategy {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::None => std::option::Option::Some(1),
Self::FallbackResponse => std::option::Option::Some(2),
Self::EndSession => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("ERROR_HANDLING_STRATEGY_UNSPECIFIED")
}
Self::None => std::option::Option::Some("NONE"),
Self::FallbackResponse => std::option::Option::Some("FALLBACK_RESPONSE"),
Self::EndSession => std::option::Option::Some("END_SESSION"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ErrorHandlingStrategy {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ErrorHandlingStrategy {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ErrorHandlingStrategy {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::None,
2 => Self::FallbackResponse,
3 => Self::EndSession,
_ => Self::UnknownValue(error_handling_strategy::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ErrorHandlingStrategy {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ERROR_HANDLING_STRATEGY_UNSPECIFIED" => Self::Unspecified,
"NONE" => Self::None,
"FALLBACK_RESPONSE" => Self::FallbackResponse,
"END_SESSION" => Self::EndSession,
_ => Self::UnknownValue(error_handling_strategy::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ErrorHandlingStrategy {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::None => serializer.serialize_i32(1),
Self::FallbackResponse => serializer.serialize_i32(2),
Self::EndSession => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ErrorHandlingStrategy {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorHandlingStrategy>::new(
".google.cloud.ces.v1.ErrorHandlingSettings.ErrorHandlingStrategy",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EvaluationMetricsThresholds {
pub golden_evaluation_metrics_thresholds: std::option::Option<
crate::model::evaluation_metrics_thresholds::GoldenEvaluationMetricsThresholds,
>,
#[deprecated]
pub hallucination_metric_behavior:
crate::model::evaluation_metrics_thresholds::HallucinationMetricBehavior,
pub golden_hallucination_metric_behavior:
crate::model::evaluation_metrics_thresholds::HallucinationMetricBehavior,
pub scenario_hallucination_metric_behavior:
crate::model::evaluation_metrics_thresholds::HallucinationMetricBehavior,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EvaluationMetricsThresholds {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_golden_evaluation_metrics_thresholds<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::evaluation_metrics_thresholds::GoldenEvaluationMetricsThresholds,
>,
{
self.golden_evaluation_metrics_thresholds = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_golden_evaluation_metrics_thresholds<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<
crate::model::evaluation_metrics_thresholds::GoldenEvaluationMetricsThresholds,
>,
{
self.golden_evaluation_metrics_thresholds = v.map(|x| x.into());
self
}
#[deprecated]
pub fn set_hallucination_metric_behavior<
T: std::convert::Into<
crate::model::evaluation_metrics_thresholds::HallucinationMetricBehavior,
>,
>(
mut self,
v: T,
) -> Self {
self.hallucination_metric_behavior = v.into();
self
}
pub fn set_golden_hallucination_metric_behavior<
T: std::convert::Into<
crate::model::evaluation_metrics_thresholds::HallucinationMetricBehavior,
>,
>(
mut self,
v: T,
) -> Self {
self.golden_hallucination_metric_behavior = v.into();
self
}
pub fn set_scenario_hallucination_metric_behavior<
T: std::convert::Into<
crate::model::evaluation_metrics_thresholds::HallucinationMetricBehavior,
>,
>(
mut self,
v: T,
) -> Self {
self.scenario_hallucination_metric_behavior = v.into();
self
}
}
impl wkt::message::Message for EvaluationMetricsThresholds {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.EvaluationMetricsThresholds"
}
}
pub mod evaluation_metrics_thresholds {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GoldenEvaluationMetricsThresholds {
pub turn_level_metrics_thresholds: std::option::Option<crate::model::evaluation_metrics_thresholds::golden_evaluation_metrics_thresholds::TurnLevelMetricsThresholds>,
pub expectation_level_metrics_thresholds: std::option::Option<crate::model::evaluation_metrics_thresholds::golden_evaluation_metrics_thresholds::ExpectationLevelMetricsThresholds>,
pub tool_matching_settings: std::option::Option<crate::model::evaluation_metrics_thresholds::ToolMatchingSettings>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GoldenEvaluationMetricsThresholds {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_turn_level_metrics_thresholds<T>(mut self, v: T) -> Self
where T: std::convert::Into<crate::model::evaluation_metrics_thresholds::golden_evaluation_metrics_thresholds::TurnLevelMetricsThresholds>
{
self.turn_level_metrics_thresholds = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_turn_level_metrics_thresholds<T>(mut self, v: std::option::Option<T>) -> Self
where T: std::convert::Into<crate::model::evaluation_metrics_thresholds::golden_evaluation_metrics_thresholds::TurnLevelMetricsThresholds>
{
self.turn_level_metrics_thresholds = v.map(|x| x.into());
self
}
pub fn set_expectation_level_metrics_thresholds<T>(mut self, v: T) -> Self
where T: std::convert::Into<crate::model::evaluation_metrics_thresholds::golden_evaluation_metrics_thresholds::ExpectationLevelMetricsThresholds>
{
self.expectation_level_metrics_thresholds = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_expectation_level_metrics_thresholds<T>(mut self, v: std::option::Option<T>) -> Self
where T: std::convert::Into<crate::model::evaluation_metrics_thresholds::golden_evaluation_metrics_thresholds::ExpectationLevelMetricsThresholds>
{
self.expectation_level_metrics_thresholds = v.map(|x| x.into());
self
}
pub fn set_tool_matching_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::evaluation_metrics_thresholds::ToolMatchingSettings,
>,
{
self.tool_matching_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tool_matching_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::evaluation_metrics_thresholds::ToolMatchingSettings,
>,
{
self.tool_matching_settings = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GoldenEvaluationMetricsThresholds {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds"
}
}
pub mod golden_evaluation_metrics_thresholds {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TurnLevelMetricsThresholds {
pub semantic_similarity_success_threshold: std::option::Option<i32>,
pub overall_tool_invocation_correctness_threshold: std::option::Option<f32>,
pub semantic_similarity_channel: crate::model::evaluation_metrics_thresholds::golden_evaluation_metrics_thresholds::turn_level_metrics_thresholds::SemanticSimilarityChannel,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TurnLevelMetricsThresholds {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_semantic_similarity_success_threshold<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.semantic_similarity_success_threshold = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_semantic_similarity_success_threshold<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<i32>,
{
self.semantic_similarity_success_threshold = v.map(|x| x.into());
self
}
pub fn set_overall_tool_invocation_correctness_threshold<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f32>,
{
self.overall_tool_invocation_correctness_threshold =
std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_overall_tool_invocation_correctness_threshold<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<f32>,
{
self.overall_tool_invocation_correctness_threshold = v.map(|x| x.into());
self
}
pub fn set_semantic_similarity_channel<T: std::convert::Into<crate::model::evaluation_metrics_thresholds::golden_evaluation_metrics_thresholds::turn_level_metrics_thresholds::SemanticSimilarityChannel>>(mut self, v: T) -> Self{
self.semantic_similarity_channel = v.into();
self
}
}
impl wkt::message::Message for TurnLevelMetricsThresholds {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds"
}
}
pub mod turn_level_metrics_thresholds {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SemanticSimilarityChannel {
Unspecified,
Text,
Audio,
UnknownValue(semantic_similarity_channel::UnknownValue),
}
#[doc(hidden)]
pub mod semantic_similarity_channel {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SemanticSimilarityChannel {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Text => std::option::Option::Some(1),
Self::Audio => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED")
}
Self::Text => std::option::Option::Some("TEXT"),
Self::Audio => std::option::Option::Some("AUDIO"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SemanticSimilarityChannel {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SemanticSimilarityChannel {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SemanticSimilarityChannel {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Text,
2 => Self::Audio,
_ => Self::UnknownValue(semantic_similarity_channel::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SemanticSimilarityChannel {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED" => Self::Unspecified,
"TEXT" => Self::Text,
"AUDIO" => Self::Audio,
_ => Self::UnknownValue(semantic_similarity_channel::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SemanticSimilarityChannel {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Text => serializer.serialize_i32(1),
Self::Audio => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SemanticSimilarityChannel {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SemanticSimilarityChannel>::new(
".google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel"))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExpectationLevelMetricsThresholds {
pub tool_invocation_parameter_correctness_threshold: std::option::Option<f32>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExpectationLevelMetricsThresholds {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tool_invocation_parameter_correctness_threshold<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f32>,
{
self.tool_invocation_parameter_correctness_threshold =
std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tool_invocation_parameter_correctness_threshold<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<f32>,
{
self.tool_invocation_parameter_correctness_threshold = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ExpectationLevelMetricsThresholds {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ToolMatchingSettings {
pub extra_tool_call_behavior: crate::model::evaluation_metrics_thresholds::tool_matching_settings::ExtraToolCallBehavior,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ToolMatchingSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_extra_tool_call_behavior<T: std::convert::Into<crate::model::evaluation_metrics_thresholds::tool_matching_settings::ExtraToolCallBehavior>>(mut self, v: T) -> Self{
self.extra_tool_call_behavior = v.into();
self
}
}
impl wkt::message::Message for ToolMatchingSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings"
}
}
pub mod tool_matching_settings {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ExtraToolCallBehavior {
Unspecified,
Fail,
Allow,
UnknownValue(extra_tool_call_behavior::UnknownValue),
}
#[doc(hidden)]
pub mod extra_tool_call_behavior {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ExtraToolCallBehavior {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Fail => std::option::Option::Some(1),
Self::Allow => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED")
}
Self::Fail => std::option::Option::Some("FAIL"),
Self::Allow => std::option::Option::Some("ALLOW"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ExtraToolCallBehavior {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ExtraToolCallBehavior {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ExtraToolCallBehavior {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Fail,
2 => Self::Allow,
_ => Self::UnknownValue(extra_tool_call_behavior::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ExtraToolCallBehavior {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED" => Self::Unspecified,
"FAIL" => Self::Fail,
"ALLOW" => Self::Allow,
_ => Self::UnknownValue(extra_tool_call_behavior::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ExtraToolCallBehavior {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Fail => serializer.serialize_i32(1),
Self::Allow => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ExtraToolCallBehavior {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExtraToolCallBehavior>::new(
".google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior"))
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum HallucinationMetricBehavior {
Unspecified,
Disabled,
Enabled,
UnknownValue(hallucination_metric_behavior::UnknownValue),
}
#[doc(hidden)]
pub mod hallucination_metric_behavior {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl HallucinationMetricBehavior {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Disabled => std::option::Option::Some(1),
Self::Enabled => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED")
}
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::Enabled => std::option::Option::Some("ENABLED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for HallucinationMetricBehavior {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for HallucinationMetricBehavior {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for HallucinationMetricBehavior {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Disabled,
2 => Self::Enabled,
_ => Self::UnknownValue(hallucination_metric_behavior::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for HallucinationMetricBehavior {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED" => Self::Unspecified,
"DISABLED" => Self::Disabled,
"ENABLED" => Self::Enabled,
_ => Self::UnknownValue(hallucination_metric_behavior::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for HallucinationMetricBehavior {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Disabled => serializer.serialize_i32(1),
Self::Enabled => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for HallucinationMetricBehavior {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<HallucinationMetricBehavior>::new(
".google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior",
),
)
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ClientCertificateSettings {
pub tls_certificate: std::string::String,
pub private_key: std::string::String,
pub passphrase: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ClientCertificateSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tls_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tls_certificate = v.into();
self
}
pub fn set_private_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.private_key = v.into();
self
}
pub fn set_passphrase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.passphrase = v.into();
self
}
}
impl wkt::message::Message for ClientCertificateSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ClientCertificateSettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VpcScSettings {
pub allowed_origins: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VpcScSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_allowed_origins<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.allowed_origins = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for VpcScSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.VpcScSettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConversationLoggingSettings {
pub disable_conversation_logging: bool,
pub retention_window: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConversationLoggingSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_disable_conversation_logging<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disable_conversation_logging = v.into();
self
}
pub fn set_retention_window<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.retention_window = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_retention_window<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.retention_window = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ConversationLoggingSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ConversationLoggingSettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudLoggingSettings {
pub enable_cloud_logging: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudLoggingSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_enable_cloud_logging<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_cloud_logging = v.into();
self
}
}
impl wkt::message::Message for CloudLoggingSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.CloudLoggingSettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AudioRecordingConfig {
pub gcs_bucket: std::string::String,
pub gcs_path_prefix: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AudioRecordingConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_gcs_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.gcs_bucket = v.into();
self
}
pub fn set_gcs_path_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.gcs_path_prefix = v.into();
self
}
}
impl wkt::message::Message for AudioRecordingConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.AudioRecordingConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RedactionConfig {
pub enable_redaction: bool,
pub inspect_template: std::string::String,
pub deidentify_template: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RedactionConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_enable_redaction<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_redaction = v.into();
self
}
pub fn set_inspect_template<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.inspect_template = v.into();
self
}
pub fn set_deidentify_template<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.deidentify_template = v.into();
self
}
}
impl wkt::message::Message for RedactionConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.RedactionConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataStoreSettings {
pub engines: std::vec::Vec<crate::model::data_store_settings::Engine>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataStoreSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_engines<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::data_store_settings::Engine>,
{
use std::iter::Iterator;
self.engines = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DataStoreSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DataStoreSettings"
}
}
pub mod data_store_settings {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Engine {
pub name: std::string::String,
pub r#type: crate::model::data_store_settings::engine::Type,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Engine {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::data_store_settings::engine::Type>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for Engine {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DataStoreSettings.Engine"
}
}
pub mod engine {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
EngineTypeSearch,
EngineTypeChat,
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::EngineTypeSearch => std::option::Option::Some(1),
Self::EngineTypeChat => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::EngineTypeSearch => std::option::Option::Some("ENGINE_TYPE_SEARCH"),
Self::EngineTypeChat => std::option::Option::Some("ENGINE_TYPE_CHAT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::EngineTypeSearch,
2 => Self::EngineTypeChat,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"ENGINE_TYPE_SEARCH" => Self::EngineTypeSearch,
"ENGINE_TYPE_CHAT" => Self::EngineTypeChat,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::EngineTypeSearch => serializer.serialize_i32(1),
Self::EngineTypeChat => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.ces.v1.DataStoreSettings.Engine.Type",
))
}
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AppSnapshot {
pub app: std::option::Option<crate::model::App>,
pub agents: std::vec::Vec<crate::model::Agent>,
pub tools: std::vec::Vec<crate::model::Tool>,
pub examples: std::vec::Vec<crate::model::Example>,
pub guardrails: std::vec::Vec<crate::model::Guardrail>,
pub toolsets: std::vec::Vec<crate::model::Toolset>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AppSnapshot {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_app<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::App>,
{
self.app = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_app<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::App>,
{
self.app = v.map(|x| x.into());
self
}
pub fn set_agents<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Agent>,
{
use std::iter::Iterator;
self.agents = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_tools<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Tool>,
{
use std::iter::Iterator;
self.tools = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_examples<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Example>,
{
use std::iter::Iterator;
self.examples = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_guardrails<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Guardrail>,
{
use std::iter::Iterator;
self.guardrails = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_toolsets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Toolset>,
{
use std::iter::Iterator;
self.toolsets = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AppSnapshot {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.AppSnapshot"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AppVersion {
pub name: std::string::String,
pub display_name: std::string::String,
pub description: std::string::String,
pub creator: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub snapshot: std::option::Option<crate::model::AppSnapshot>,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AppVersion {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.creator = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_snapshot<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AppSnapshot>,
{
self.snapshot = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AppSnapshot>,
{
self.snapshot = v.map(|x| x.into());
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for AppVersion {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.AppVersion"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ApiKeyConfig {
pub key_name: std::string::String,
pub api_key_secret_version: std::string::String,
pub request_location: crate::model::api_key_config::RequestLocation,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ApiKeyConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.key_name = v.into();
self
}
pub fn set_api_key_secret_version<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.api_key_secret_version = v.into();
self
}
pub fn set_request_location<
T: std::convert::Into<crate::model::api_key_config::RequestLocation>,
>(
mut self,
v: T,
) -> Self {
self.request_location = v.into();
self
}
}
impl wkt::message::Message for ApiKeyConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ApiKeyConfig"
}
}
pub mod api_key_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RequestLocation {
Unspecified,
Header,
QueryString,
UnknownValue(request_location::UnknownValue),
}
#[doc(hidden)]
pub mod request_location {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RequestLocation {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Header => std::option::Option::Some(1),
Self::QueryString => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("REQUEST_LOCATION_UNSPECIFIED"),
Self::Header => std::option::Option::Some("HEADER"),
Self::QueryString => std::option::Option::Some("QUERY_STRING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RequestLocation {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RequestLocation {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for RequestLocation {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Header,
2 => Self::QueryString,
_ => Self::UnknownValue(request_location::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RequestLocation {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"REQUEST_LOCATION_UNSPECIFIED" => Self::Unspecified,
"HEADER" => Self::Header,
"QUERY_STRING" => Self::QueryString,
_ => Self::UnknownValue(request_location::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RequestLocation {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Header => serializer.serialize_i32(1),
Self::QueryString => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RequestLocation {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RequestLocation>::new(
".google.cloud.ces.v1.ApiKeyConfig.RequestLocation",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OAuthConfig {
pub oauth_grant_type: crate::model::o_auth_config::OauthGrantType,
pub client_id: std::string::String,
pub client_secret_version: std::string::String,
pub token_endpoint: std::string::String,
pub scopes: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OAuthConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_oauth_grant_type<
T: std::convert::Into<crate::model::o_auth_config::OauthGrantType>,
>(
mut self,
v: T,
) -> Self {
self.oauth_grant_type = v.into();
self
}
pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.client_id = v.into();
self
}
pub fn set_client_secret_version<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.client_secret_version = v.into();
self
}
pub fn set_token_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.token_endpoint = v.into();
self
}
pub fn set_scopes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.scopes = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for OAuthConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.OAuthConfig"
}
}
pub mod o_auth_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum OauthGrantType {
Unspecified,
ClientCredential,
UnknownValue(oauth_grant_type::UnknownValue),
}
#[doc(hidden)]
pub mod oauth_grant_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl OauthGrantType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ClientCredential => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("OAUTH_GRANT_TYPE_UNSPECIFIED"),
Self::ClientCredential => std::option::Option::Some("CLIENT_CREDENTIAL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for OauthGrantType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for OauthGrantType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for OauthGrantType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ClientCredential,
_ => Self::UnknownValue(oauth_grant_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for OauthGrantType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"OAUTH_GRANT_TYPE_UNSPECIFIED" => Self::Unspecified,
"CLIENT_CREDENTIAL" => Self::ClientCredential,
_ => Self::UnknownValue(oauth_grant_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for OauthGrantType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ClientCredential => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for OauthGrantType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<OauthGrantType>::new(
".google.cloud.ces.v1.OAuthConfig.OauthGrantType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceAgentIdTokenAuthConfig {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ServiceAgentIdTokenAuthConfig {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for ServiceAgentIdTokenAuthConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceAccountAuthConfig {
pub service_account: std::string::String,
pub scopes: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ServiceAccountAuthConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_account = v.into();
self
}
pub fn set_scopes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.scopes = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ServiceAccountAuthConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ServiceAccountAuthConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BearerTokenConfig {
pub token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BearerTokenConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.token = v.into();
self
}
}
impl wkt::message::Message for BearerTokenConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.BearerTokenConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EndUserAuthConfig {
pub auth_config: std::option::Option<crate::model::end_user_auth_config::AuthConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EndUserAuthConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_auth_config<
T: std::convert::Into<std::option::Option<crate::model::end_user_auth_config::AuthConfig>>,
>(
mut self,
v: T,
) -> Self {
self.auth_config = v.into();
self
}
pub fn oauth2_auth_code_config(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::end_user_auth_config::Oauth2AuthCodeConfig>,
> {
#[allow(unreachable_patterns)]
self.auth_config.as_ref().and_then(|v| match v {
crate::model::end_user_auth_config::AuthConfig::Oauth2AuthCodeConfig(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_oauth2_auth_code_config<
T: std::convert::Into<
std::boxed::Box<crate::model::end_user_auth_config::Oauth2AuthCodeConfig>,
>,
>(
mut self,
v: T,
) -> Self {
self.auth_config = std::option::Option::Some(
crate::model::end_user_auth_config::AuthConfig::Oauth2AuthCodeConfig(v.into()),
);
self
}
pub fn oauth2_jwt_bearer_config(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::end_user_auth_config::Oauth2JwtBearerConfig>,
> {
#[allow(unreachable_patterns)]
self.auth_config.as_ref().and_then(|v| match v {
crate::model::end_user_auth_config::AuthConfig::Oauth2JwtBearerConfig(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_oauth2_jwt_bearer_config<
T: std::convert::Into<
std::boxed::Box<crate::model::end_user_auth_config::Oauth2JwtBearerConfig>,
>,
>(
mut self,
v: T,
) -> Self {
self.auth_config = std::option::Option::Some(
crate::model::end_user_auth_config::AuthConfig::Oauth2JwtBearerConfig(v.into()),
);
self
}
}
impl wkt::message::Message for EndUserAuthConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.EndUserAuthConfig"
}
}
pub mod end_user_auth_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Oauth2AuthCodeConfig {
pub oauth_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Oauth2AuthCodeConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_oauth_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.oauth_token = v.into();
self
}
}
impl wkt::message::Message for Oauth2AuthCodeConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Oauth2JwtBearerConfig {
pub issuer: std::string::String,
pub subject: std::string::String,
pub client_key: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Oauth2JwtBearerConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_issuer<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.issuer = v.into();
self
}
pub fn set_subject<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.subject = v.into();
self
}
pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.client_key = v.into();
self
}
}
impl wkt::message::Message for Oauth2JwtBearerConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AuthConfig {
Oauth2AuthCodeConfig(
std::boxed::Box<crate::model::end_user_auth_config::Oauth2AuthCodeConfig>,
),
Oauth2JwtBearerConfig(
std::boxed::Box<crate::model::end_user_auth_config::Oauth2JwtBearerConfig>,
),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ApiAuthentication {
pub auth_config: std::option::Option<crate::model::api_authentication::AuthConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ApiAuthentication {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_auth_config<
T: std::convert::Into<std::option::Option<crate::model::api_authentication::AuthConfig>>,
>(
mut self,
v: T,
) -> Self {
self.auth_config = v.into();
self
}
pub fn api_key_config(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ApiKeyConfig>> {
#[allow(unreachable_patterns)]
self.auth_config.as_ref().and_then(|v| match v {
crate::model::api_authentication::AuthConfig::ApiKeyConfig(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_api_key_config<
T: std::convert::Into<std::boxed::Box<crate::model::ApiKeyConfig>>,
>(
mut self,
v: T,
) -> Self {
self.auth_config = std::option::Option::Some(
crate::model::api_authentication::AuthConfig::ApiKeyConfig(v.into()),
);
self
}
pub fn oauth_config(&self) -> std::option::Option<&std::boxed::Box<crate::model::OAuthConfig>> {
#[allow(unreachable_patterns)]
self.auth_config.as_ref().and_then(|v| match v {
crate::model::api_authentication::AuthConfig::OauthConfig(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_oauth_config<T: std::convert::Into<std::boxed::Box<crate::model::OAuthConfig>>>(
mut self,
v: T,
) -> Self {
self.auth_config = std::option::Option::Some(
crate::model::api_authentication::AuthConfig::OauthConfig(v.into()),
);
self
}
pub fn service_agent_id_token_auth_config(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ServiceAgentIdTokenAuthConfig>> {
#[allow(unreachable_patterns)]
self.auth_config.as_ref().and_then(|v| match v {
crate::model::api_authentication::AuthConfig::ServiceAgentIdTokenAuthConfig(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_service_agent_id_token_auth_config<
T: std::convert::Into<std::boxed::Box<crate::model::ServiceAgentIdTokenAuthConfig>>,
>(
mut self,
v: T,
) -> Self {
self.auth_config = std::option::Option::Some(
crate::model::api_authentication::AuthConfig::ServiceAgentIdTokenAuthConfig(v.into()),
);
self
}
pub fn service_account_auth_config(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ServiceAccountAuthConfig>> {
#[allow(unreachable_patterns)]
self.auth_config.as_ref().and_then(|v| match v {
crate::model::api_authentication::AuthConfig::ServiceAccountAuthConfig(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_service_account_auth_config<
T: std::convert::Into<std::boxed::Box<crate::model::ServiceAccountAuthConfig>>,
>(
mut self,
v: T,
) -> Self {
self.auth_config = std::option::Option::Some(
crate::model::api_authentication::AuthConfig::ServiceAccountAuthConfig(v.into()),
);
self
}
pub fn bearer_token_config(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::BearerTokenConfig>> {
#[allow(unreachable_patterns)]
self.auth_config.as_ref().and_then(|v| match v {
crate::model::api_authentication::AuthConfig::BearerTokenConfig(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_bearer_token_config<
T: std::convert::Into<std::boxed::Box<crate::model::BearerTokenConfig>>,
>(
mut self,
v: T,
) -> Self {
self.auth_config = std::option::Option::Some(
crate::model::api_authentication::AuthConfig::BearerTokenConfig(v.into()),
);
self
}
}
impl wkt::message::Message for ApiAuthentication {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ApiAuthentication"
}
}
pub mod api_authentication {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AuthConfig {
ApiKeyConfig(std::boxed::Box<crate::model::ApiKeyConfig>),
OauthConfig(std::boxed::Box<crate::model::OAuthConfig>),
ServiceAgentIdTokenAuthConfig(std::boxed::Box<crate::model::ServiceAgentIdTokenAuthConfig>),
ServiceAccountAuthConfig(std::boxed::Box<crate::model::ServiceAccountAuthConfig>),
BearerTokenConfig(std::boxed::Box<crate::model::BearerTokenConfig>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BigQueryExportSettings {
pub enabled: bool,
pub project: std::string::String,
pub dataset: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BigQueryExportSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enabled = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.dataset = v.into();
self
}
}
impl wkt::message::Message for BigQueryExportSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.BigQueryExportSettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Changelog {
pub name: std::string::String,
pub author: std::string::String,
pub display_name: std::string::String,
pub description: std::string::String,
pub resource: std::string::String,
pub resource_type: std::string::String,
pub action: std::string::String,
pub original_resource: std::option::Option<wkt::Struct>,
pub new_resource: std::option::Option<wkt::Struct>,
pub dependent_resources: std::vec::Vec<wkt::Struct>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub sequence_number: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Changelog {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_author<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.author = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource = v.into();
self
}
pub fn set_resource_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource_type = v.into();
self
}
pub fn set_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.action = v.into();
self
}
pub fn set_original_resource<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.original_resource = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_original_resource<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.original_resource = v.map(|x| x.into());
self
}
pub fn set_new_resource<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.new_resource = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_new_resource<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.new_resource = v.map(|x| x.into());
self
}
pub fn set_dependent_resources<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<wkt::Struct>,
{
use std::iter::Iterator;
self.dependent_resources = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_sequence_number<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.sequence_number = v.into();
self
}
}
impl wkt::message::Message for Changelog {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Changelog"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ClientFunction {
pub name: std::string::String,
pub description: std::string::String,
pub parameters: std::option::Option<crate::model::Schema>,
pub response: std::option::Option<crate::model::Schema>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ClientFunction {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_parameters<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.parameters = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_parameters<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.parameters = v.map(|x| x.into());
self
}
pub fn set_response<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.response = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_response<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.response = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ClientFunction {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ClientFunction"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Callback {
pub description: std::string::String,
pub disabled: bool,
pub proactive_execution_enabled: bool,
pub callback: std::option::Option<crate::model::callback::Callback>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Callback {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disabled = v.into();
self
}
pub fn set_proactive_execution_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.proactive_execution_enabled = v.into();
self
}
pub fn set_callback<
T: std::convert::Into<std::option::Option<crate::model::callback::Callback>>,
>(
mut self,
v: T,
) -> Self {
self.callback = v.into();
self
}
pub fn python_code(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.callback.as_ref().and_then(|v| match v {
crate::model::callback::Callback::PythonCode(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_python_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.callback =
std::option::Option::Some(crate::model::callback::Callback::PythonCode(v.into()));
self
}
}
impl wkt::message::Message for Callback {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Callback"
}
}
pub mod callback {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Callback {
PythonCode(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ModelSettings {
pub model: std::string::String,
pub temperature: std::option::Option<f64>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ModelSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.model = v.into();
self
}
pub fn set_temperature<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f64>,
{
self.temperature = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_temperature<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<f64>,
{
self.temperature = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ModelSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ModelSettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TriggerAction {
pub action: std::option::Option<crate::model::trigger_action::Action>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TriggerAction {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_action<
T: std::convert::Into<std::option::Option<crate::model::trigger_action::Action>>,
>(
mut self,
v: T,
) -> Self {
self.action = v.into();
self
}
pub fn respond_immediately(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::trigger_action::RespondImmediately>>
{
#[allow(unreachable_patterns)]
self.action.as_ref().and_then(|v| match v {
crate::model::trigger_action::Action::RespondImmediately(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_respond_immediately<
T: std::convert::Into<std::boxed::Box<crate::model::trigger_action::RespondImmediately>>,
>(
mut self,
v: T,
) -> Self {
self.action = std::option::Option::Some(
crate::model::trigger_action::Action::RespondImmediately(v.into()),
);
self
}
pub fn transfer_agent(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::trigger_action::TransferAgent>> {
#[allow(unreachable_patterns)]
self.action.as_ref().and_then(|v| match v {
crate::model::trigger_action::Action::TransferAgent(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_transfer_agent<
T: std::convert::Into<std::boxed::Box<crate::model::trigger_action::TransferAgent>>,
>(
mut self,
v: T,
) -> Self {
self.action = std::option::Option::Some(
crate::model::trigger_action::Action::TransferAgent(v.into()),
);
self
}
pub fn generative_answer(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::trigger_action::GenerativeAnswer>> {
#[allow(unreachable_patterns)]
self.action.as_ref().and_then(|v| match v {
crate::model::trigger_action::Action::GenerativeAnswer(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_generative_answer<
T: std::convert::Into<std::boxed::Box<crate::model::trigger_action::GenerativeAnswer>>,
>(
mut self,
v: T,
) -> Self {
self.action = std::option::Option::Some(
crate::model::trigger_action::Action::GenerativeAnswer(v.into()),
);
self
}
}
impl wkt::message::Message for TriggerAction {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.TriggerAction"
}
}
pub mod trigger_action {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Response {
pub text: std::string::String,
pub disabled: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Response {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.text = v.into();
self
}
pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disabled = v.into();
self
}
}
impl wkt::message::Message for Response {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.TriggerAction.Response"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RespondImmediately {
pub responses: std::vec::Vec<crate::model::trigger_action::Response>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RespondImmediately {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_responses<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::trigger_action::Response>,
{
use std::iter::Iterator;
self.responses = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RespondImmediately {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.TriggerAction.RespondImmediately"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GenerativeAnswer {
pub prompt: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GenerativeAnswer {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_prompt<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.prompt = v.into();
self
}
}
impl wkt::message::Message for GenerativeAnswer {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.TriggerAction.GenerativeAnswer"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TransferAgent {
pub agent: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TransferAgent {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_agent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.agent = v.into();
self
}
}
impl wkt::message::Message for TransferAgent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.TriggerAction.TransferAgent"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Action {
RespondImmediately(std::boxed::Box<crate::model::trigger_action::RespondImmediately>),
TransferAgent(std::boxed::Box<crate::model::trigger_action::TransferAgent>),
GenerativeAnswer(std::boxed::Box<crate::model::trigger_action::GenerativeAnswer>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TlsConfig {
pub ca_certs: std::vec::Vec<crate::model::tls_config::CaCert>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TlsConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ca_certs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::tls_config::CaCert>,
{
use std::iter::Iterator;
self.ca_certs = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for TlsConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.TlsConfig"
}
}
pub mod tls_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CaCert {
pub display_name: std::string::String,
pub cert: ::bytes::Bytes,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CaCert {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.display_name = v.into();
self
}
pub fn set_cert<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.cert = v.into();
self
}
}
impl wkt::message::Message for CaCert {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.TlsConfig.CaCert"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceDirectoryConfig {
pub service: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ServiceDirectoryConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service = v.into();
self
}
}
impl wkt::message::Message for ServiceDirectoryConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ServiceDirectoryConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ChannelProfile {
pub profile_id: std::string::String,
pub channel_type: crate::model::channel_profile::ChannelType,
pub persona_property: std::option::Option<crate::model::channel_profile::PersonaProperty>,
pub disable_dtmf: bool,
pub disable_barge_in_control: bool,
pub web_widget_config: std::option::Option<crate::model::channel_profile::WebWidgetConfig>,
pub noise_suppression_level: std::string::String,
pub whatsapp_config: std::option::Option<crate::model::channel_profile::WhatsAppConfig>,
pub instagram_config: std::option::Option<crate::model::channel_profile::InstagramConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ChannelProfile {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_profile_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.profile_id = v.into();
self
}
pub fn set_channel_type<T: std::convert::Into<crate::model::channel_profile::ChannelType>>(
mut self,
v: T,
) -> Self {
self.channel_type = v.into();
self
}
pub fn set_persona_property<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::channel_profile::PersonaProperty>,
{
self.persona_property = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_persona_property<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::channel_profile::PersonaProperty>,
{
self.persona_property = v.map(|x| x.into());
self
}
pub fn set_disable_dtmf<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disable_dtmf = v.into();
self
}
pub fn set_disable_barge_in_control<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disable_barge_in_control = v.into();
self
}
pub fn set_web_widget_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::channel_profile::WebWidgetConfig>,
{
self.web_widget_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_web_widget_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::channel_profile::WebWidgetConfig>,
{
self.web_widget_config = v.map(|x| x.into());
self
}
pub fn set_noise_suppression_level<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.noise_suppression_level = v.into();
self
}
pub fn set_whatsapp_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::channel_profile::WhatsAppConfig>,
{
self.whatsapp_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_whatsapp_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::channel_profile::WhatsAppConfig>,
{
self.whatsapp_config = v.map(|x| x.into());
self
}
pub fn set_instagram_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::channel_profile::InstagramConfig>,
{
self.instagram_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_instagram_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::channel_profile::InstagramConfig>,
{
self.instagram_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ChannelProfile {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ChannelProfile"
}
}
pub mod channel_profile {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PersonaProperty {
pub persona: crate::model::channel_profile::persona_property::Persona,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PersonaProperty {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_persona<
T: std::convert::Into<crate::model::channel_profile::persona_property::Persona>,
>(
mut self,
v: T,
) -> Self {
self.persona = v.into();
self
}
}
impl wkt::message::Message for PersonaProperty {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ChannelProfile.PersonaProperty"
}
}
pub mod persona_property {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Persona {
Unknown,
Concise,
Chatty,
UnknownValue(persona::UnknownValue),
}
#[doc(hidden)]
pub mod persona {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Persona {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unknown => std::option::Option::Some(0),
Self::Concise => std::option::Option::Some(1),
Self::Chatty => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unknown => std::option::Option::Some("UNKNOWN"),
Self::Concise => std::option::Option::Some("CONCISE"),
Self::Chatty => std::option::Option::Some("CHATTY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Persona {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Persona {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Persona {
fn from(value: i32) -> Self {
match value {
0 => Self::Unknown,
1 => Self::Concise,
2 => Self::Chatty,
_ => Self::UnknownValue(persona::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Persona {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"UNKNOWN" => Self::Unknown,
"CONCISE" => Self::Concise,
"CHATTY" => Self::Chatty,
_ => Self::UnknownValue(persona::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Persona {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unknown => serializer.serialize_i32(0),
Self::Concise => serializer.serialize_i32(1),
Self::Chatty => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Persona {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Persona>::new(
".google.cloud.ces.v1.ChannelProfile.PersonaProperty.Persona",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WebWidgetConfig {
pub modality: crate::model::channel_profile::web_widget_config::Modality,
pub theme: crate::model::channel_profile::web_widget_config::Theme,
pub web_widget_title: std::string::String,
pub security_settings:
std::option::Option<crate::model::channel_profile::web_widget_config::SecuritySettings>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WebWidgetConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_modality<
T: std::convert::Into<crate::model::channel_profile::web_widget_config::Modality>,
>(
mut self,
v: T,
) -> Self {
self.modality = v.into();
self
}
pub fn set_theme<
T: std::convert::Into<crate::model::channel_profile::web_widget_config::Theme>,
>(
mut self,
v: T,
) -> Self {
self.theme = v.into();
self
}
pub fn set_web_widget_title<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.web_widget_title = v.into();
self
}
pub fn set_security_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::channel_profile::web_widget_config::SecuritySettings,
>,
{
self.security_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_security_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::channel_profile::web_widget_config::SecuritySettings,
>,
{
self.security_settings = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for WebWidgetConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ChannelProfile.WebWidgetConfig"
}
}
pub mod web_widget_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SecuritySettings {
pub enable_public_access: bool,
pub enable_origin_check: bool,
pub allowed_origins: std::vec::Vec<std::string::String>,
pub enable_recaptcha: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SecuritySettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_enable_public_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_public_access = v.into();
self
}
pub fn set_enable_origin_check<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_origin_check = v.into();
self
}
pub fn set_allowed_origins<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.allowed_origins = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_enable_recaptcha<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_recaptcha = v.into();
self
}
}
impl wkt::message::Message for SecuritySettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Modality {
Unspecified,
ChatAndVoice,
VoiceOnly,
ChatOnly,
ChatVoiceAndVideo,
UnknownValue(modality::UnknownValue),
}
#[doc(hidden)]
pub mod modality {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Modality {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ChatAndVoice => std::option::Option::Some(1),
Self::VoiceOnly => std::option::Option::Some(2),
Self::ChatOnly => std::option::Option::Some(3),
Self::ChatVoiceAndVideo => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("MODALITY_UNSPECIFIED"),
Self::ChatAndVoice => std::option::Option::Some("CHAT_AND_VOICE"),
Self::VoiceOnly => std::option::Option::Some("VOICE_ONLY"),
Self::ChatOnly => std::option::Option::Some("CHAT_ONLY"),
Self::ChatVoiceAndVideo => std::option::Option::Some("CHAT_VOICE_AND_VIDEO"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Modality {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Modality {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Modality {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ChatAndVoice,
2 => Self::VoiceOnly,
3 => Self::ChatOnly,
4 => Self::ChatVoiceAndVideo,
_ => Self::UnknownValue(modality::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Modality {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MODALITY_UNSPECIFIED" => Self::Unspecified,
"CHAT_AND_VOICE" => Self::ChatAndVoice,
"VOICE_ONLY" => Self::VoiceOnly,
"CHAT_ONLY" => Self::ChatOnly,
"CHAT_VOICE_AND_VIDEO" => Self::ChatVoiceAndVideo,
_ => Self::UnknownValue(modality::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Modality {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ChatAndVoice => serializer.serialize_i32(1),
Self::VoiceOnly => serializer.serialize_i32(2),
Self::ChatOnly => serializer.serialize_i32(3),
Self::ChatVoiceAndVideo => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Modality {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Modality>::new(
".google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Modality",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Theme {
Unspecified,
Light,
Dark,
UnknownValue(theme::UnknownValue),
}
#[doc(hidden)]
pub mod theme {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Theme {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Light => std::option::Option::Some(1),
Self::Dark => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("THEME_UNSPECIFIED"),
Self::Light => std::option::Option::Some("LIGHT"),
Self::Dark => std::option::Option::Some("DARK"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Theme {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Theme {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Theme {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Light,
2 => Self::Dark,
_ => Self::UnknownValue(theme::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Theme {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"THEME_UNSPECIFIED" => Self::Unspecified,
"LIGHT" => Self::Light,
"DARK" => Self::Dark,
_ => Self::UnknownValue(theme::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Theme {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Light => serializer.serialize_i32(1),
Self::Dark => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Theme {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Theme>::new(
".google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Theme",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WhatsAppConfig {
pub waba_id: std::string::String,
pub phone_number_id: std::string::String,
pub phone_number: std::string::String,
pub display_name: std::string::String,
pub thumbnail_url: std::string::String,
pub description: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WhatsAppConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_waba_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.waba_id = v.into();
self
}
pub fn set_phone_number_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.phone_number_id = v.into();
self
}
pub fn set_phone_number<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.phone_number = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.display_name = v.into();
self
}
pub fn set_thumbnail_url<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.thumbnail_url = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
}
impl wkt::message::Message for WhatsAppConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ChannelProfile.WhatsAppConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramConfig {
pub instagram_account_id: std::string::String,
pub display_name: std::string::String,
pub thumbnail_url: std::string::String,
pub description: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstagramConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instagram_account_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.instagram_account_id = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.display_name = v.into();
self
}
pub fn set_thumbnail_url<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.thumbnail_url = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
}
impl wkt::message::Message for InstagramConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ChannelProfile.InstagramConfig"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ChannelType {
Unknown,
WebUi,
Api,
Twilio,
GoogleTelephonyPlatform,
ContactCenterAsAService,
ContactCenterAsAServiceChat,
Five9,
ContactCenterIntegration,
Whatsapp,
Instagram,
UnknownValue(channel_type::UnknownValue),
}
#[doc(hidden)]
pub mod channel_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ChannelType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unknown => std::option::Option::Some(0),
Self::WebUi => std::option::Option::Some(2),
Self::Api => std::option::Option::Some(3),
Self::Twilio => std::option::Option::Some(4),
Self::GoogleTelephonyPlatform => std::option::Option::Some(5),
Self::ContactCenterAsAService => std::option::Option::Some(6),
Self::ContactCenterAsAServiceChat => std::option::Option::Some(11),
Self::Five9 => std::option::Option::Some(7),
Self::ContactCenterIntegration => std::option::Option::Some(8),
Self::Whatsapp => std::option::Option::Some(9),
Self::Instagram => std::option::Option::Some(10),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unknown => std::option::Option::Some("UNKNOWN"),
Self::WebUi => std::option::Option::Some("WEB_UI"),
Self::Api => std::option::Option::Some("API"),
Self::Twilio => std::option::Option::Some("TWILIO"),
Self::GoogleTelephonyPlatform => {
std::option::Option::Some("GOOGLE_TELEPHONY_PLATFORM")
}
Self::ContactCenterAsAService => {
std::option::Option::Some("CONTACT_CENTER_AS_A_SERVICE")
}
Self::ContactCenterAsAServiceChat => {
std::option::Option::Some("CONTACT_CENTER_AS_A_SERVICE_CHAT")
}
Self::Five9 => std::option::Option::Some("FIVE9"),
Self::ContactCenterIntegration => {
std::option::Option::Some("CONTACT_CENTER_INTEGRATION")
}
Self::Whatsapp => std::option::Option::Some("WHATSAPP"),
Self::Instagram => std::option::Option::Some("INSTAGRAM"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ChannelType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ChannelType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ChannelType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unknown,
2 => Self::WebUi,
3 => Self::Api,
4 => Self::Twilio,
5 => Self::GoogleTelephonyPlatform,
6 => Self::ContactCenterAsAService,
7 => Self::Five9,
8 => Self::ContactCenterIntegration,
9 => Self::Whatsapp,
10 => Self::Instagram,
11 => Self::ContactCenterAsAServiceChat,
_ => Self::UnknownValue(channel_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ChannelType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"UNKNOWN" => Self::Unknown,
"WEB_UI" => Self::WebUi,
"API" => Self::Api,
"TWILIO" => Self::Twilio,
"GOOGLE_TELEPHONY_PLATFORM" => Self::GoogleTelephonyPlatform,
"CONTACT_CENTER_AS_A_SERVICE" => Self::ContactCenterAsAService,
"CONTACT_CENTER_AS_A_SERVICE_CHAT" => Self::ContactCenterAsAServiceChat,
"FIVE9" => Self::Five9,
"CONTACT_CENTER_INTEGRATION" => Self::ContactCenterIntegration,
"WHATSAPP" => Self::Whatsapp,
"INSTAGRAM" => Self::Instagram,
_ => Self::UnknownValue(channel_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ChannelType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unknown => serializer.serialize_i32(0),
Self::WebUi => serializer.serialize_i32(2),
Self::Api => serializer.serialize_i32(3),
Self::Twilio => serializer.serialize_i32(4),
Self::GoogleTelephonyPlatform => serializer.serialize_i32(5),
Self::ContactCenterAsAService => serializer.serialize_i32(6),
Self::ContactCenterAsAServiceChat => serializer.serialize_i32(11),
Self::Five9 => serializer.serialize_i32(7),
Self::ContactCenterIntegration => serializer.serialize_i32(8),
Self::Whatsapp => serializer.serialize_i32(9),
Self::Instagram => serializer.serialize_i32(10),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ChannelType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ChannelType>::new(
".google.cloud.ces.v1.ChannelProfile.ChannelType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Span {
pub name: std::string::String,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub duration: std::option::Option<wkt::Duration>,
pub attributes: std::option::Option<wkt::Struct>,
pub child_spans: std::vec::Vec<crate::model::Span>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Span {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.duration = v.map(|x| x.into());
self
}
pub fn set_attributes<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.attributes = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_attributes<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.attributes = v.map(|x| x.into());
self
}
pub fn set_child_spans<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Span>,
{
use std::iter::Iterator;
self.child_spans = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Span {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Span"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Action {
pub input_fields: std::vec::Vec<std::string::String>,
pub output_fields: std::vec::Vec<std::string::String>,
pub action_spec: std::option::Option<crate::model::action::ActionSpec>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Action {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_input_fields<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.input_fields = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_output_fields<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.output_fields = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_action_spec<
T: std::convert::Into<std::option::Option<crate::model::action::ActionSpec>>,
>(
mut self,
v: T,
) -> Self {
self.action_spec = v.into();
self
}
pub fn connection_action_id(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.action_spec.as_ref().and_then(|v| match v {
crate::model::action::ActionSpec::ConnectionActionId(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_connection_action_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.action_spec = std::option::Option::Some(
crate::model::action::ActionSpec::ConnectionActionId(v.into()),
);
self
}
pub fn entity_operation(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::action::EntityOperation>> {
#[allow(unreachable_patterns)]
self.action_spec.as_ref().and_then(|v| match v {
crate::model::action::ActionSpec::EntityOperation(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_entity_operation<
T: std::convert::Into<std::boxed::Box<crate::model::action::EntityOperation>>,
>(
mut self,
v: T,
) -> Self {
self.action_spec =
std::option::Option::Some(crate::model::action::ActionSpec::EntityOperation(v.into()));
self
}
}
impl wkt::message::Message for Action {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Action"
}
}
pub mod action {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EntityOperation {
pub entity_id: std::string::String,
pub operation: crate::model::action::entity_operation::OperationType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EntityOperation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entity_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.entity_id = v.into();
self
}
pub fn set_operation<
T: std::convert::Into<crate::model::action::entity_operation::OperationType>,
>(
mut self,
v: T,
) -> Self {
self.operation = v.into();
self
}
}
impl wkt::message::Message for EntityOperation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Action.EntityOperation"
}
}
pub mod entity_operation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum OperationType {
Unspecified,
List,
Get,
Create,
Update,
Delete,
UnknownValue(operation_type::UnknownValue),
}
#[doc(hidden)]
pub mod operation_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl OperationType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::List => std::option::Option::Some(1),
Self::Get => std::option::Option::Some(2),
Self::Create => std::option::Option::Some(3),
Self::Update => std::option::Option::Some(4),
Self::Delete => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("OPERATION_TYPE_UNSPECIFIED"),
Self::List => std::option::Option::Some("LIST"),
Self::Get => std::option::Option::Some("GET"),
Self::Create => std::option::Option::Some("CREATE"),
Self::Update => std::option::Option::Some("UPDATE"),
Self::Delete => std::option::Option::Some("DELETE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for OperationType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for OperationType {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for OperationType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::List,
2 => Self::Get,
3 => Self::Create,
4 => Self::Update,
5 => Self::Delete,
_ => Self::UnknownValue(operation_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for OperationType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
"LIST" => Self::List,
"GET" => Self::Get,
"CREATE" => Self::Create,
"UPDATE" => Self::Update,
"DELETE" => Self::Delete,
_ => Self::UnknownValue(operation_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for OperationType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::List => serializer.serialize_i32(1),
Self::Get => serializer.serialize_i32(2),
Self::Create => serializer.serialize_i32(3),
Self::Update => serializer.serialize_i32(4),
Self::Delete => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for OperationType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperationType>::new(
".google.cloud.ces.v1.Action.EntityOperation.OperationType",
))
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ActionSpec {
ConnectionActionId(std::string::String),
EntityOperation(std::boxed::Box<crate::model::action::EntityOperation>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConnectorTool {
pub connection: std::string::String,
pub action: std::option::Option<crate::model::Action>,
pub auth_config: std::option::Option<crate::model::EndUserAuthConfig>,
pub name: std::string::String,
pub description: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConnectorTool {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.connection = v.into();
self
}
pub fn set_action<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Action>,
{
self.action = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_action<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Action>,
{
self.action = v.map(|x| x.into());
self
}
pub fn set_auth_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EndUserAuthConfig>,
{
self.auth_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_auth_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EndUserAuthConfig>,
{
self.auth_config = v.map(|x| x.into());
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
}
impl wkt::message::Message for ConnectorTool {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ConnectorTool"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConnectorToolset {
pub connection: std::string::String,
pub auth_config: std::option::Option<crate::model::EndUserAuthConfig>,
pub connector_actions: std::vec::Vec<crate::model::Action>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConnectorToolset {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.connection = v.into();
self
}
pub fn set_auth_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EndUserAuthConfig>,
{
self.auth_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_auth_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EndUserAuthConfig>,
{
self.auth_config = v.map(|x| x.into());
self
}
pub fn set_connector_actions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Action>,
{
use std::iter::Iterator;
self.connector_actions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ConnectorToolset {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ConnectorToolset"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Conversation {
pub name: std::string::String,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub turns: std::vec::Vec<crate::model::conversation::Turn>,
pub turn_count: i32,
#[deprecated]
pub channel_type: crate::model::conversation::ChannelType,
pub source: crate::model::conversation::Source,
pub input_types: std::vec::Vec<crate::model::conversation::InputType>,
pub entry_agent: std::string::String,
pub deployment: std::string::String,
pub app_version: std::string::String,
pub language_code: std::string::String,
#[deprecated]
pub messages: std::vec::Vec<crate::model::Message>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Conversation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_turns<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::conversation::Turn>,
{
use std::iter::Iterator;
self.turns = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_turn_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.turn_count = v.into();
self
}
#[deprecated]
pub fn set_channel_type<T: std::convert::Into<crate::model::conversation::ChannelType>>(
mut self,
v: T,
) -> Self {
self.channel_type = v.into();
self
}
pub fn set_source<T: std::convert::Into<crate::model::conversation::Source>>(
mut self,
v: T,
) -> Self {
self.source = v.into();
self
}
pub fn set_input_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::conversation::InputType>,
{
use std::iter::Iterator;
self.input_types = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_entry_agent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.entry_agent = v.into();
self
}
pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.deployment = v.into();
self
}
pub fn set_app_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.app_version = v.into();
self
}
pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.language_code = v.into();
self
}
#[deprecated]
pub fn set_messages<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Message>,
{
use std::iter::Iterator;
self.messages = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Conversation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Conversation"
}
}
pub mod conversation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Turn {
pub messages: std::vec::Vec<crate::model::Message>,
pub root_span: std::option::Option<crate::model::Span>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Turn {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_messages<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Message>,
{
use std::iter::Iterator;
self.messages = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_root_span<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Span>,
{
self.root_span = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_root_span<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Span>,
{
self.root_span = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Turn {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Conversation.Turn"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ChannelType {
Unspecified,
Text,
Audio,
Multimodal,
UnknownValue(channel_type::UnknownValue),
}
#[doc(hidden)]
pub mod channel_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ChannelType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Text => std::option::Option::Some(1),
Self::Audio => std::option::Option::Some(2),
Self::Multimodal => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CHANNEL_TYPE_UNSPECIFIED"),
Self::Text => std::option::Option::Some("TEXT"),
Self::Audio => std::option::Option::Some("AUDIO"),
Self::Multimodal => std::option::Option::Some("MULTIMODAL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ChannelType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ChannelType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ChannelType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Text,
2 => Self::Audio,
3 => Self::Multimodal,
_ => Self::UnknownValue(channel_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ChannelType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CHANNEL_TYPE_UNSPECIFIED" => Self::Unspecified,
"TEXT" => Self::Text,
"AUDIO" => Self::Audio,
"MULTIMODAL" => Self::Multimodal,
_ => Self::UnknownValue(channel_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ChannelType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Text => serializer.serialize_i32(1),
Self::Audio => serializer.serialize_i32(2),
Self::Multimodal => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ChannelType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ChannelType>::new(
".google.cloud.ces.v1.Conversation.ChannelType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Source {
Unspecified,
Live,
Simulator,
Eval,
AgentTool,
UnknownValue(source::UnknownValue),
}
#[doc(hidden)]
pub mod source {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Source {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Live => std::option::Option::Some(1),
Self::Simulator => std::option::Option::Some(2),
Self::Eval => std::option::Option::Some(3),
Self::AgentTool => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SOURCE_UNSPECIFIED"),
Self::Live => std::option::Option::Some("LIVE"),
Self::Simulator => std::option::Option::Some("SIMULATOR"),
Self::Eval => std::option::Option::Some("EVAL"),
Self::AgentTool => std::option::Option::Some("AGENT_TOOL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Source {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Source {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Source {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Live,
2 => Self::Simulator,
3 => Self::Eval,
4 => Self::AgentTool,
_ => Self::UnknownValue(source::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Source {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SOURCE_UNSPECIFIED" => Self::Unspecified,
"LIVE" => Self::Live,
"SIMULATOR" => Self::Simulator,
"EVAL" => Self::Eval,
"AGENT_TOOL" => Self::AgentTool,
_ => Self::UnknownValue(source::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Source {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Live => serializer.serialize_i32(1),
Self::Simulator => serializer.serialize_i32(2),
Self::Eval => serializer.serialize_i32(3),
Self::AgentTool => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Source {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Source>::new(
".google.cloud.ces.v1.Conversation.Source",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum InputType {
Unspecified,
Text,
Event,
Audio,
Image,
Blob,
ToolResponse,
Variables,
UnknownValue(input_type::UnknownValue),
}
#[doc(hidden)]
pub mod input_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl InputType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Text => std::option::Option::Some(1),
Self::Event => std::option::Option::Some(7),
Self::Audio => std::option::Option::Some(2),
Self::Image => std::option::Option::Some(3),
Self::Blob => std::option::Option::Some(4),
Self::ToolResponse => std::option::Option::Some(5),
Self::Variables => std::option::Option::Some(6),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("INPUT_TYPE_UNSPECIFIED"),
Self::Text => std::option::Option::Some("INPUT_TYPE_TEXT"),
Self::Event => std::option::Option::Some("INPUT_TYPE_EVENT"),
Self::Audio => std::option::Option::Some("INPUT_TYPE_AUDIO"),
Self::Image => std::option::Option::Some("INPUT_TYPE_IMAGE"),
Self::Blob => std::option::Option::Some("INPUT_TYPE_BLOB"),
Self::ToolResponse => std::option::Option::Some("INPUT_TYPE_TOOL_RESPONSE"),
Self::Variables => std::option::Option::Some("INPUT_TYPE_VARIABLES"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for InputType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for InputType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for InputType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Text,
2 => Self::Audio,
3 => Self::Image,
4 => Self::Blob,
5 => Self::ToolResponse,
6 => Self::Variables,
7 => Self::Event,
_ => Self::UnknownValue(input_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for InputType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"INPUT_TYPE_UNSPECIFIED" => Self::Unspecified,
"INPUT_TYPE_TEXT" => Self::Text,
"INPUT_TYPE_EVENT" => Self::Event,
"INPUT_TYPE_AUDIO" => Self::Audio,
"INPUT_TYPE_IMAGE" => Self::Image,
"INPUT_TYPE_BLOB" => Self::Blob,
"INPUT_TYPE_TOOL_RESPONSE" => Self::ToolResponse,
"INPUT_TYPE_VARIABLES" => Self::Variables,
_ => Self::UnknownValue(input_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for InputType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Text => serializer.serialize_i32(1),
Self::Event => serializer.serialize_i32(7),
Self::Audio => serializer.serialize_i32(2),
Self::Image => serializer.serialize_i32(3),
Self::Blob => serializer.serialize_i32(4),
Self::ToolResponse => serializer.serialize_i32(5),
Self::Variables => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for InputType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<InputType>::new(
".google.cloud.ces.v1.Conversation.InputType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataStore {
pub name: std::string::String,
pub r#type: crate::model::data_store::DataStoreType,
pub document_processing_mode: crate::model::data_store::DocumentProcessingMode,
pub display_name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub connector_config: std::option::Option<crate::model::data_store::ConnectorConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataStore {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::data_store::DataStoreType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_document_processing_mode<
T: std::convert::Into<crate::model::data_store::DocumentProcessingMode>,
>(
mut self,
v: T,
) -> Self {
self.document_processing_mode = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_connector_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_store::ConnectorConfig>,
{
self.connector_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_connector_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_store::ConnectorConfig>,
{
self.connector_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DataStore {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DataStore"
}
}
pub mod data_store {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConnectorConfig {
pub collection: std::string::String,
pub collection_display_name: std::string::String,
pub data_source: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConnectorConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_collection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.collection = v.into();
self
}
pub fn set_collection_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.collection_display_name = v.into();
self
}
pub fn set_data_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.data_source = v.into();
self
}
}
impl wkt::message::Message for ConnectorConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DataStore.ConnectorConfig"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DataStoreType {
Unspecified,
PublicWeb,
Unstructured,
Faq,
Connector,
UnknownValue(data_store_type::UnknownValue),
}
#[doc(hidden)]
pub mod data_store_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DataStoreType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::PublicWeb => std::option::Option::Some(1),
Self::Unstructured => std::option::Option::Some(2),
Self::Faq => std::option::Option::Some(3),
Self::Connector => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("DATA_STORE_TYPE_UNSPECIFIED"),
Self::PublicWeb => std::option::Option::Some("PUBLIC_WEB"),
Self::Unstructured => std::option::Option::Some("UNSTRUCTURED"),
Self::Faq => std::option::Option::Some("FAQ"),
Self::Connector => std::option::Option::Some("CONNECTOR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DataStoreType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DataStoreType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for DataStoreType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::PublicWeb,
2 => Self::Unstructured,
3 => Self::Faq,
4 => Self::Connector,
_ => Self::UnknownValue(data_store_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DataStoreType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DATA_STORE_TYPE_UNSPECIFIED" => Self::Unspecified,
"PUBLIC_WEB" => Self::PublicWeb,
"UNSTRUCTURED" => Self::Unstructured,
"FAQ" => Self::Faq,
"CONNECTOR" => Self::Connector,
_ => Self::UnknownValue(data_store_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DataStoreType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::PublicWeb => serializer.serialize_i32(1),
Self::Unstructured => serializer.serialize_i32(2),
Self::Faq => serializer.serialize_i32(3),
Self::Connector => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DataStoreType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataStoreType>::new(
".google.cloud.ces.v1.DataStore.DataStoreType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DocumentProcessingMode {
Unspecified,
Documents,
Chunks,
UnknownValue(document_processing_mode::UnknownValue),
}
#[doc(hidden)]
pub mod document_processing_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DocumentProcessingMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Documents => std::option::Option::Some(1),
Self::Chunks => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("DOCUMENT_PROCESSING_MODE_UNSPECIFIED")
}
Self::Documents => std::option::Option::Some("DOCUMENTS"),
Self::Chunks => std::option::Option::Some("CHUNKS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DocumentProcessingMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DocumentProcessingMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for DocumentProcessingMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Documents,
2 => Self::Chunks,
_ => Self::UnknownValue(document_processing_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DocumentProcessingMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DOCUMENT_PROCESSING_MODE_UNSPECIFIED" => Self::Unspecified,
"DOCUMENTS" => Self::Documents,
"CHUNKS" => Self::Chunks,
_ => Self::UnknownValue(document_processing_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DocumentProcessingMode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Documents => serializer.serialize_i32(1),
Self::Chunks => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DocumentProcessingMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DocumentProcessingMode>::new(
".google.cloud.ces.v1.DataStore.DocumentProcessingMode",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataStoreTool {
pub name: std::string::String,
pub description: std::string::String,
pub boost_specs: std::vec::Vec<crate::model::data_store_tool::BoostSpecs>,
pub modality_configs: std::vec::Vec<crate::model::data_store_tool::ModalityConfig>,
pub filter_parameter_behavior: crate::model::data_store_tool::FilterParameterBehavior,
pub search_source: std::option::Option<crate::model::data_store_tool::SearchSource>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataStoreTool {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_boost_specs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::data_store_tool::BoostSpecs>,
{
use std::iter::Iterator;
self.boost_specs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_modality_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::data_store_tool::ModalityConfig>,
{
use std::iter::Iterator;
self.modality_configs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_filter_parameter_behavior<
T: std::convert::Into<crate::model::data_store_tool::FilterParameterBehavior>,
>(
mut self,
v: T,
) -> Self {
self.filter_parameter_behavior = v.into();
self
}
pub fn set_search_source<
T: std::convert::Into<std::option::Option<crate::model::data_store_tool::SearchSource>>,
>(
mut self,
v: T,
) -> Self {
self.search_source = v.into();
self
}
pub fn data_store_source(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::data_store_tool::DataStoreSource>> {
#[allow(unreachable_patterns)]
self.search_source.as_ref().and_then(|v| match v {
crate::model::data_store_tool::SearchSource::DataStoreSource(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_data_store_source<
T: std::convert::Into<std::boxed::Box<crate::model::data_store_tool::DataStoreSource>>,
>(
mut self,
v: T,
) -> Self {
self.search_source = std::option::Option::Some(
crate::model::data_store_tool::SearchSource::DataStoreSource(v.into()),
);
self
}
pub fn engine_source(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::data_store_tool::EngineSource>> {
#[allow(unreachable_patterns)]
self.search_source.as_ref().and_then(|v| match v {
crate::model::data_store_tool::SearchSource::EngineSource(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_engine_source<
T: std::convert::Into<std::boxed::Box<crate::model::data_store_tool::EngineSource>>,
>(
mut self,
v: T,
) -> Self {
self.search_source = std::option::Option::Some(
crate::model::data_store_tool::SearchSource::EngineSource(v.into()),
);
self
}
}
impl wkt::message::Message for DataStoreTool {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DataStoreTool"
}
}
pub mod data_store_tool {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RewriterConfig {
pub model_settings: std::option::Option<crate::model::ModelSettings>,
pub prompt: std::string::String,
pub disabled: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RewriterConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_model_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ModelSettings>,
{
self.model_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_model_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ModelSettings>,
{
self.model_settings = v.map(|x| x.into());
self
}
pub fn set_prompt<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.prompt = v.into();
self
}
pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disabled = v.into();
self
}
}
impl wkt::message::Message for RewriterConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DataStoreTool.RewriterConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SummarizationConfig {
pub model_settings: std::option::Option<crate::model::ModelSettings>,
pub prompt: std::string::String,
pub disabled: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SummarizationConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_model_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ModelSettings>,
{
self.model_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_model_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ModelSettings>,
{
self.model_settings = v.map(|x| x.into());
self
}
pub fn set_prompt<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.prompt = v.into();
self
}
pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disabled = v.into();
self
}
}
impl wkt::message::Message for SummarizationConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DataStoreTool.SummarizationConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GroundingConfig {
pub grounding_level: f32,
pub disabled: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GroundingConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_grounding_level<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.grounding_level = v.into();
self
}
pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disabled = v.into();
self
}
}
impl wkt::message::Message for GroundingConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DataStoreTool.GroundingConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataStoreSource {
pub filter: std::string::String,
pub data_store: std::option::Option<crate::model::DataStore>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataStoreSource {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_data_store<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataStore>,
{
self.data_store = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_data_store<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataStore>,
{
self.data_store = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DataStoreSource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DataStoreTool.DataStoreSource"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EngineSource {
pub engine: std::string::String,
pub data_store_sources: std::vec::Vec<crate::model::data_store_tool::DataStoreSource>,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EngineSource {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_engine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.engine = v.into();
self
}
pub fn set_data_store_sources<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::data_store_tool::DataStoreSource>,
{
use std::iter::Iterator;
self.data_store_sources = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for EngineSource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DataStoreTool.EngineSource"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BoostSpecs {
pub data_stores: std::vec::Vec<std::string::String>,
pub spec: std::vec::Vec<crate::model::data_store_tool::BoostSpec>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BoostSpecs {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data_stores<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.data_stores = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_spec<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::data_store_tool::BoostSpec>,
{
use std::iter::Iterator;
self.spec = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for BoostSpecs {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DataStoreTool.BoostSpecs"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BoostSpec {
pub condition_boost_specs:
std::vec::Vec<crate::model::data_store_tool::boost_spec::ConditionBoostSpec>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BoostSpec {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_condition_boost_specs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::data_store_tool::boost_spec::ConditionBoostSpec>,
{
use std::iter::Iterator;
self.condition_boost_specs = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for BoostSpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DataStoreTool.BoostSpec"
}
}
pub mod boost_spec {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConditionBoostSpec {
pub condition: std::string::String,
pub boost: f32,
pub boost_control_spec: std::option::Option<
crate::model::data_store_tool::boost_spec::condition_boost_spec::BoostControlSpec,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConditionBoostSpec {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_condition<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.condition = v.into();
self
}
pub fn set_boost<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.boost = v.into();
self
}
pub fn set_boost_control_spec<T>(mut self, v: T) -> Self
where T: std::convert::Into<crate::model::data_store_tool::boost_spec::condition_boost_spec::BoostControlSpec>
{
self.boost_control_spec = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_boost_control_spec<T>(mut self, v: std::option::Option<T>) -> Self
where T: std::convert::Into<crate::model::data_store_tool::boost_spec::condition_boost_spec::BoostControlSpec>
{
self.boost_control_spec = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ConditionBoostSpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec"
}
}
pub mod condition_boost_spec {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BoostControlSpec {
pub field_name: std::string::String,
pub attribute_type: crate::model::data_store_tool::boost_spec::condition_boost_spec::boost_control_spec::AttributeType,
pub interpolation_type: crate::model::data_store_tool::boost_spec::condition_boost_spec::boost_control_spec::InterpolationType,
pub control_points: std::vec::Vec<crate::model::data_store_tool::boost_spec::condition_boost_spec::boost_control_spec::ControlPoint>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BoostControlSpec {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_field_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.field_name = v.into();
self
}
pub fn set_attribute_type<T: std::convert::Into<crate::model::data_store_tool::boost_spec::condition_boost_spec::boost_control_spec::AttributeType>>(mut self, v: T) -> Self{
self.attribute_type = v.into();
self
}
pub fn set_interpolation_type<T: std::convert::Into<crate::model::data_store_tool::boost_spec::condition_boost_spec::boost_control_spec::InterpolationType>>(mut self, v: T) -> Self{
self.interpolation_type = v.into();
self
}
pub fn set_control_points<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::data_store_tool::boost_spec::condition_boost_spec::boost_control_spec::ControlPoint>
{
use std::iter::Iterator;
self.control_points = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for BoostControlSpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec"
}
}
pub mod boost_control_spec {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ControlPoint {
pub attribute_value: std::string::String,
pub boost_amount: f32,
pub(crate) _unknown_fields:
serde_json::Map<std::string::String, serde_json::Value>,
}
impl ControlPoint {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_attribute_value<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.attribute_value = v.into();
self
}
pub fn set_boost_amount<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.boost_amount = v.into();
self
}
}
impl wkt::message::Message for ControlPoint {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AttributeType {
Unspecified,
Numerical,
Freshness,
UnknownValue(attribute_type::UnknownValue),
}
#[doc(hidden)]
pub mod attribute_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl AttributeType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Numerical => std::option::Option::Some(1),
Self::Freshness => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("ATTRIBUTE_TYPE_UNSPECIFIED")
}
Self::Numerical => std::option::Option::Some("NUMERICAL"),
Self::Freshness => std::option::Option::Some("FRESHNESS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for AttributeType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for AttributeType {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for AttributeType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Numerical,
2 => Self::Freshness,
_ => Self::UnknownValue(attribute_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for AttributeType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ATTRIBUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
"NUMERICAL" => Self::Numerical,
"FRESHNESS" => Self::Freshness,
_ => Self::UnknownValue(attribute_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for AttributeType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Numerical => serializer.serialize_i32(1),
Self::Freshness => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for AttributeType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<AttributeType>::new(
".google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType"))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum InterpolationType {
Unspecified,
Linear,
UnknownValue(interpolation_type::UnknownValue),
}
#[doc(hidden)]
pub mod interpolation_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl InterpolationType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Linear => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("INTERPOLATION_TYPE_UNSPECIFIED")
}
Self::Linear => std::option::Option::Some("LINEAR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for InterpolationType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for InterpolationType {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for InterpolationType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Linear,
_ => Self::UnknownValue(interpolation_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for InterpolationType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"INTERPOLATION_TYPE_UNSPECIFIED" => Self::Unspecified,
"LINEAR" => Self::Linear,
_ => Self::UnknownValue(interpolation_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for InterpolationType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Linear => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for InterpolationType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<InterpolationType>::new(
".google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType"))
}
}
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ModalityConfig {
pub modality_type: crate::model::data_store_tool::modality_config::ModalityType,
pub rewriter_config: std::option::Option<crate::model::data_store_tool::RewriterConfig>,
pub summarization_config:
std::option::Option<crate::model::data_store_tool::SummarizationConfig>,
pub grounding_config: std::option::Option<crate::model::data_store_tool::GroundingConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ModalityConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_modality_type<
T: std::convert::Into<crate::model::data_store_tool::modality_config::ModalityType>,
>(
mut self,
v: T,
) -> Self {
self.modality_type = v.into();
self
}
pub fn set_rewriter_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_store_tool::RewriterConfig>,
{
self.rewriter_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_rewriter_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_store_tool::RewriterConfig>,
{
self.rewriter_config = v.map(|x| x.into());
self
}
pub fn set_summarization_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_store_tool::SummarizationConfig>,
{
self.summarization_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_summarization_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_store_tool::SummarizationConfig>,
{
self.summarization_config = v.map(|x| x.into());
self
}
pub fn set_grounding_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::data_store_tool::GroundingConfig>,
{
self.grounding_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_grounding_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::data_store_tool::GroundingConfig>,
{
self.grounding_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ModalityConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.DataStoreTool.ModalityConfig"
}
}
pub mod modality_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ModalityType {
Unspecified,
Text,
Audio,
UnknownValue(modality_type::UnknownValue),
}
#[doc(hidden)]
pub mod modality_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ModalityType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Text => std::option::Option::Some(1),
Self::Audio => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("MODALITY_TYPE_UNSPECIFIED"),
Self::Text => std::option::Option::Some("TEXT"),
Self::Audio => std::option::Option::Some("AUDIO"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ModalityType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ModalityType {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ModalityType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Text,
2 => Self::Audio,
_ => Self::UnknownValue(modality_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ModalityType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MODALITY_TYPE_UNSPECIFIED" => Self::Unspecified,
"TEXT" => Self::Text,
"AUDIO" => Self::Audio,
_ => Self::UnknownValue(modality_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ModalityType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Text => serializer.serialize_i32(1),
Self::Audio => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ModalityType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ModalityType>::new(
".google.cloud.ces.v1.DataStoreTool.ModalityConfig.ModalityType",
))
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FilterParameterBehavior {
Unspecified,
AlwaysInclude,
NeverInclude,
UnknownValue(filter_parameter_behavior::UnknownValue),
}
#[doc(hidden)]
pub mod filter_parameter_behavior {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl FilterParameterBehavior {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::AlwaysInclude => std::option::Option::Some(2),
Self::NeverInclude => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED")
}
Self::AlwaysInclude => std::option::Option::Some("ALWAYS_INCLUDE"),
Self::NeverInclude => std::option::Option::Some("NEVER_INCLUDE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for FilterParameterBehavior {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for FilterParameterBehavior {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for FilterParameterBehavior {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
2 => Self::AlwaysInclude,
3 => Self::NeverInclude,
_ => Self::UnknownValue(filter_parameter_behavior::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for FilterParameterBehavior {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED" => Self::Unspecified,
"ALWAYS_INCLUDE" => Self::AlwaysInclude,
"NEVER_INCLUDE" => Self::NeverInclude,
_ => Self::UnknownValue(filter_parameter_behavior::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for FilterParameterBehavior {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::AlwaysInclude => serializer.serialize_i32(2),
Self::NeverInclude => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for FilterParameterBehavior {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<FilterParameterBehavior>::new(
".google.cloud.ces.v1.DataStoreTool.FilterParameterBehavior",
),
)
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SearchSource {
DataStoreSource(std::boxed::Box<crate::model::data_store_tool::DataStoreSource>),
EngineSource(std::boxed::Box<crate::model::data_store_tool::EngineSource>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExperimentConfig {
pub version_release: std::option::Option<crate::model::experiment_config::VersionRelease>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExperimentConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_version_release<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::experiment_config::VersionRelease>,
{
self.version_release = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_version_release<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::experiment_config::VersionRelease>,
{
self.version_release = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ExperimentConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ExperimentConfig"
}
}
pub mod experiment_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VersionRelease {
pub state: crate::model::experiment_config::State,
pub traffic_allocations:
std::vec::Vec<crate::model::experiment_config::version_release::TrafficAllocation>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VersionRelease {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_state<T: std::convert::Into<crate::model::experiment_config::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_traffic_allocations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<
crate::model::experiment_config::version_release::TrafficAllocation,
>,
{
use std::iter::Iterator;
self.traffic_allocations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for VersionRelease {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ExperimentConfig.VersionRelease"
}
}
pub mod version_release {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TrafficAllocation {
pub id: std::string::String,
pub traffic_percentage: i32,
pub app_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TrafficAllocation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_traffic_percentage<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.traffic_percentage = v.into();
self
}
pub fn set_app_version<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.app_version = v.into();
self
}
}
impl wkt::message::Message for TrafficAllocation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ExperimentConfig.VersionRelease.TrafficAllocation"
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Pending,
Running,
Done,
Expired,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Pending => std::option::Option::Some(1),
Self::Running => std::option::Option::Some(2),
Self::Done => std::option::Option::Some(3),
Self::Expired => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Done => std::option::Option::Some("DONE"),
Self::Expired => std::option::Option::Some("EXPIRED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pending,
2 => Self::Running,
3 => Self::Done,
4 => Self::Expired,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"PENDING" => Self::Pending,
"RUNNING" => Self::Running,
"DONE" => Self::Done,
"EXPIRED" => Self::Expired,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Pending => serializer.serialize_i32(1),
Self::Running => serializer.serialize_i32(2),
Self::Done => serializer.serialize_i32(3),
Self::Expired => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.ces.v1.ExperimentConfig.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Deployment {
pub name: std::string::String,
pub display_name: std::string::String,
pub app_version: std::string::String,
pub channel_profile: std::option::Option<crate::model::ChannelProfile>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub etag: std::string::String,
pub experiment_config: std::option::Option<crate::model::ExperimentConfig>,
pub whatsapp_credentials: std::option::Option<crate::model::WhatsAppCredentials>,
pub instagram_credentials: std::option::Option<crate::model::InstagramCredentials>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Deployment {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_app_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.app_version = v.into();
self
}
pub fn set_channel_profile<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ChannelProfile>,
{
self.channel_profile = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_channel_profile<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ChannelProfile>,
{
self.channel_profile = v.map(|x| x.into());
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_experiment_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ExperimentConfig>,
{
self.experiment_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_experiment_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ExperimentConfig>,
{
self.experiment_config = v.map(|x| x.into());
self
}
pub fn set_whatsapp_credentials<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::WhatsAppCredentials>,
{
self.whatsapp_credentials = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_whatsapp_credentials<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::WhatsAppCredentials>,
{
self.whatsapp_credentials = v.map(|x| x.into());
self
}
pub fn set_instagram_credentials<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstagramCredentials>,
{
self.instagram_credentials = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_instagram_credentials<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstagramCredentials>,
{
self.instagram_credentials = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Deployment {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Deployment"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WhatsAppCredentials {
pub auth_code: std::string::String,
pub pin: std::string::String,
pub phone_number: std::string::String,
pub business_account_id: std::string::String,
pub waba_id: std::string::String,
pub conversation_profile_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WhatsAppCredentials {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_auth_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.auth_code = v.into();
self
}
pub fn set_pin<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pin = v.into();
self
}
pub fn set_phone_number<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.phone_number = v.into();
self
}
pub fn set_business_account_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.business_account_id = v.into();
self
}
pub fn set_waba_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.waba_id = v.into();
self
}
pub fn set_conversation_profile_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.conversation_profile_id = v.into();
self
}
}
impl wkt::message::Message for WhatsAppCredentials {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.WhatsAppCredentials"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramCredentials {
pub auth_code: std::string::String,
pub conversation_profile_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstagramCredentials {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_auth_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.auth_code = v.into();
self
}
pub fn set_conversation_profile_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.conversation_profile_id = v.into();
self
}
}
impl wkt::message::Message for InstagramCredentials {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.InstagramCredentials"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Example {
pub name: std::string::String,
pub display_name: std::string::String,
pub description: std::string::String,
pub entry_agent: std::string::String,
pub messages: std::vec::Vec<crate::model::Message>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub invalid: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Example {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_entry_agent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.entry_agent = v.into();
self
}
pub fn set_messages<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Message>,
{
use std::iter::Iterator;
self.messages = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_invalid<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.invalid = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for Example {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Example"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Message {
pub role: std::string::String,
pub chunks: std::vec::Vec<crate::model::Chunk>,
pub event_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Message {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_role<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.role = v.into();
self
}
pub fn set_chunks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Chunk>,
{
use std::iter::Iterator;
self.chunks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_event_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.event_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_event_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.event_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Message {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Message"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Chunk {
pub data: std::option::Option<crate::model::chunk::Data>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Chunk {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data<T: std::convert::Into<std::option::Option<crate::model::chunk::Data>>>(
mut self,
v: T,
) -> Self {
self.data = v.into();
self
}
pub fn text(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.data.as_ref().and_then(|v| match v {
crate::model::chunk::Data::Text(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.data = std::option::Option::Some(crate::model::chunk::Data::Text(v.into()));
self
}
pub fn transcript(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.data.as_ref().and_then(|v| match v {
crate::model::chunk::Data::Transcript(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_transcript<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.data = std::option::Option::Some(crate::model::chunk::Data::Transcript(v.into()));
self
}
pub fn blob(&self) -> std::option::Option<&std::boxed::Box<crate::model::Blob>> {
#[allow(unreachable_patterns)]
self.data.as_ref().and_then(|v| match v {
crate::model::chunk::Data::Blob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_blob<T: std::convert::Into<std::boxed::Box<crate::model::Blob>>>(
mut self,
v: T,
) -> Self {
self.data = std::option::Option::Some(crate::model::chunk::Data::Blob(v.into()));
self
}
pub fn payload(&self) -> std::option::Option<&std::boxed::Box<wkt::Struct>> {
#[allow(unreachable_patterns)]
self.data.as_ref().and_then(|v| match v {
crate::model::chunk::Data::Payload(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_payload<T: std::convert::Into<std::boxed::Box<wkt::Struct>>>(
mut self,
v: T,
) -> Self {
self.data = std::option::Option::Some(crate::model::chunk::Data::Payload(v.into()));
self
}
pub fn image(&self) -> std::option::Option<&std::boxed::Box<crate::model::Image>> {
#[allow(unreachable_patterns)]
self.data.as_ref().and_then(|v| match v {
crate::model::chunk::Data::Image(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_image<T: std::convert::Into<std::boxed::Box<crate::model::Image>>>(
mut self,
v: T,
) -> Self {
self.data = std::option::Option::Some(crate::model::chunk::Data::Image(v.into()));
self
}
pub fn tool_call(&self) -> std::option::Option<&std::boxed::Box<crate::model::ToolCall>> {
#[allow(unreachable_patterns)]
self.data.as_ref().and_then(|v| match v {
crate::model::chunk::Data::ToolCall(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_tool_call<T: std::convert::Into<std::boxed::Box<crate::model::ToolCall>>>(
mut self,
v: T,
) -> Self {
self.data = std::option::Option::Some(crate::model::chunk::Data::ToolCall(v.into()));
self
}
pub fn tool_response(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ToolResponse>> {
#[allow(unreachable_patterns)]
self.data.as_ref().and_then(|v| match v {
crate::model::chunk::Data::ToolResponse(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_tool_response<T: std::convert::Into<std::boxed::Box<crate::model::ToolResponse>>>(
mut self,
v: T,
) -> Self {
self.data = std::option::Option::Some(crate::model::chunk::Data::ToolResponse(v.into()));
self
}
pub fn agent_transfer(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AgentTransfer>> {
#[allow(unreachable_patterns)]
self.data.as_ref().and_then(|v| match v {
crate::model::chunk::Data::AgentTransfer(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_agent_transfer<
T: std::convert::Into<std::boxed::Box<crate::model::AgentTransfer>>,
>(
mut self,
v: T,
) -> Self {
self.data = std::option::Option::Some(crate::model::chunk::Data::AgentTransfer(v.into()));
self
}
pub fn updated_variables(&self) -> std::option::Option<&std::boxed::Box<wkt::Struct>> {
#[allow(unreachable_patterns)]
self.data.as_ref().and_then(|v| match v {
crate::model::chunk::Data::UpdatedVariables(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_updated_variables<T: std::convert::Into<std::boxed::Box<wkt::Struct>>>(
mut self,
v: T,
) -> Self {
self.data =
std::option::Option::Some(crate::model::chunk::Data::UpdatedVariables(v.into()));
self
}
pub fn default_variables(&self) -> std::option::Option<&std::boxed::Box<wkt::Struct>> {
#[allow(unreachable_patterns)]
self.data.as_ref().and_then(|v| match v {
crate::model::chunk::Data::DefaultVariables(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_default_variables<T: std::convert::Into<std::boxed::Box<wkt::Struct>>>(
mut self,
v: T,
) -> Self {
self.data =
std::option::Option::Some(crate::model::chunk::Data::DefaultVariables(v.into()));
self
}
}
impl wkt::message::Message for Chunk {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Chunk"
}
}
pub mod chunk {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Data {
Text(std::string::String),
Transcript(std::string::String),
Blob(std::boxed::Box<crate::model::Blob>),
Payload(std::boxed::Box<wkt::Struct>),
Image(std::boxed::Box<crate::model::Image>),
ToolCall(std::boxed::Box<crate::model::ToolCall>),
ToolResponse(std::boxed::Box<crate::model::ToolResponse>),
AgentTransfer(std::boxed::Box<crate::model::AgentTransfer>),
UpdatedVariables(std::boxed::Box<wkt::Struct>),
DefaultVariables(std::boxed::Box<wkt::Struct>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Blob {
pub mime_type: std::string::String,
pub data: ::bytes::Bytes,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Blob {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.mime_type = v.into();
self
}
pub fn set_data<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.data = v.into();
self
}
}
impl wkt::message::Message for Blob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Blob"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Image {
pub mime_type: std::string::String,
pub data: ::bytes::Bytes,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Image {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.mime_type = v.into();
self
}
pub fn set_data<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.data = v.into();
self
}
}
impl wkt::message::Message for Image {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Image"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ToolCall {
pub id: std::string::String,
pub display_name: std::string::String,
pub args: std::option::Option<wkt::Struct>,
pub tool_identifier: std::option::Option<crate::model::tool_call::ToolIdentifier>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ToolCall {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_args<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.args = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_args<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.args = v.map(|x| x.into());
self
}
pub fn set_tool_identifier<
T: std::convert::Into<std::option::Option<crate::model::tool_call::ToolIdentifier>>,
>(
mut self,
v: T,
) -> Self {
self.tool_identifier = v.into();
self
}
pub fn tool(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.tool_identifier.as_ref().and_then(|v| match v {
crate::model::tool_call::ToolIdentifier::Tool(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_tool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tool_identifier =
std::option::Option::Some(crate::model::tool_call::ToolIdentifier::Tool(v.into()));
self
}
pub fn toolset_tool(&self) -> std::option::Option<&std::boxed::Box<crate::model::ToolsetTool>> {
#[allow(unreachable_patterns)]
self.tool_identifier.as_ref().and_then(|v| match v {
crate::model::tool_call::ToolIdentifier::ToolsetTool(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_toolset_tool<T: std::convert::Into<std::boxed::Box<crate::model::ToolsetTool>>>(
mut self,
v: T,
) -> Self {
self.tool_identifier = std::option::Option::Some(
crate::model::tool_call::ToolIdentifier::ToolsetTool(v.into()),
);
self
}
}
impl wkt::message::Message for ToolCall {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ToolCall"
}
}
pub mod tool_call {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ToolIdentifier {
Tool(std::string::String),
ToolsetTool(std::boxed::Box<crate::model::ToolsetTool>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ToolResponse {
pub id: std::string::String,
pub display_name: std::string::String,
pub response: std::option::Option<wkt::Struct>,
pub tool_identifier: std::option::Option<crate::model::tool_response::ToolIdentifier>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ToolResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_response<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.response = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_response<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.response = v.map(|x| x.into());
self
}
pub fn set_tool_identifier<
T: std::convert::Into<std::option::Option<crate::model::tool_response::ToolIdentifier>>,
>(
mut self,
v: T,
) -> Self {
self.tool_identifier = v.into();
self
}
pub fn tool(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.tool_identifier.as_ref().and_then(|v| match v {
crate::model::tool_response::ToolIdentifier::Tool(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_tool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tool_identifier =
std::option::Option::Some(crate::model::tool_response::ToolIdentifier::Tool(v.into()));
self
}
pub fn toolset_tool(&self) -> std::option::Option<&std::boxed::Box<crate::model::ToolsetTool>> {
#[allow(unreachable_patterns)]
self.tool_identifier.as_ref().and_then(|v| match v {
crate::model::tool_response::ToolIdentifier::ToolsetTool(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_toolset_tool<T: std::convert::Into<std::boxed::Box<crate::model::ToolsetTool>>>(
mut self,
v: T,
) -> Self {
self.tool_identifier = std::option::Option::Some(
crate::model::tool_response::ToolIdentifier::ToolsetTool(v.into()),
);
self
}
}
impl wkt::message::Message for ToolResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ToolResponse"
}
}
pub mod tool_response {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ToolIdentifier {
Tool(std::string::String),
ToolsetTool(std::boxed::Box<crate::model::ToolsetTool>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AgentTransfer {
pub target_agent: std::string::String,
pub display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AgentTransfer {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_target_agent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_agent = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
}
impl wkt::message::Message for AgentTransfer {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.AgentTransfer"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CodeBlock {
pub python_code: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CodeBlock {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_python_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.python_code = v.into();
self
}
}
impl wkt::message::Message for CodeBlock {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.CodeBlock"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ToolFakeConfig {
pub enable_fake_mode: bool,
pub tool_response: std::option::Option<crate::model::tool_fake_config::ToolResponse>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ToolFakeConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_enable_fake_mode<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_fake_mode = v.into();
self
}
pub fn set_tool_response<
T: std::convert::Into<std::option::Option<crate::model::tool_fake_config::ToolResponse>>,
>(
mut self,
v: T,
) -> Self {
self.tool_response = v.into();
self
}
pub fn code_block(&self) -> std::option::Option<&std::boxed::Box<crate::model::CodeBlock>> {
#[allow(unreachable_patterns)]
self.tool_response.as_ref().and_then(|v| match v {
crate::model::tool_fake_config::ToolResponse::CodeBlock(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_code_block<T: std::convert::Into<std::boxed::Box<crate::model::CodeBlock>>>(
mut self,
v: T,
) -> Self {
self.tool_response = std::option::Option::Some(
crate::model::tool_fake_config::ToolResponse::CodeBlock(v.into()),
);
self
}
}
impl wkt::message::Message for ToolFakeConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ToolFakeConfig"
}
}
pub mod tool_fake_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ToolResponse {
CodeBlock(std::boxed::Box<crate::model::CodeBlock>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FileSearchTool {
pub corpus_type: crate::model::file_search_tool::CorpusType,
pub name: std::string::String,
pub description: std::string::String,
pub file_corpus: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FileSearchTool {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_corpus_type<T: std::convert::Into<crate::model::file_search_tool::CorpusType>>(
mut self,
v: T,
) -> Self {
self.corpus_type = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_file_corpus<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.file_corpus = v.into();
self
}
}
impl wkt::message::Message for FileSearchTool {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.FileSearchTool"
}
}
pub mod file_search_tool {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CorpusType {
Unspecified,
UserOwned,
FullyManaged,
UnknownValue(corpus_type::UnknownValue),
}
#[doc(hidden)]
pub mod corpus_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CorpusType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::UserOwned => std::option::Option::Some(1),
Self::FullyManaged => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CORPUS_TYPE_UNSPECIFIED"),
Self::UserOwned => std::option::Option::Some("USER_OWNED"),
Self::FullyManaged => std::option::Option::Some("FULLY_MANAGED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CorpusType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CorpusType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for CorpusType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::UserOwned,
2 => Self::FullyManaged,
_ => Self::UnknownValue(corpus_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CorpusType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CORPUS_TYPE_UNSPECIFIED" => Self::Unspecified,
"USER_OWNED" => Self::UserOwned,
"FULLY_MANAGED" => Self::FullyManaged,
_ => Self::UnknownValue(corpus_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CorpusType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::UserOwned => serializer.serialize_i32(1),
Self::FullyManaged => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CorpusType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<CorpusType>::new(
".google.cloud.ces.v1.FileSearchTool.CorpusType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GoogleSearchTool {
pub name: std::string::String,
pub description: std::string::String,
pub context_urls: std::vec::Vec<std::string::String>,
pub preferred_domains: std::vec::Vec<std::string::String>,
pub exclude_domains: std::vec::Vec<std::string::String>,
pub prompt_config: std::option::Option<crate::model::google_search_tool::PromptConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GoogleSearchTool {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_context_urls<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.context_urls = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_preferred_domains<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.preferred_domains = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_exclude_domains<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.exclude_domains = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_prompt_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::google_search_tool::PromptConfig>,
{
self.prompt_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_prompt_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::google_search_tool::PromptConfig>,
{
self.prompt_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GoogleSearchTool {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.GoogleSearchTool"
}
}
pub mod google_search_tool {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PromptConfig {
pub text_prompt: std::string::String,
pub voice_prompt: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PromptConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_text_prompt<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.text_prompt = v.into();
self
}
pub fn set_voice_prompt<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.voice_prompt = v.into();
self
}
}
impl wkt::message::Message for PromptConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.GoogleSearchTool.PromptConfig"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Guardrail {
pub name: std::string::String,
pub display_name: std::string::String,
pub description: std::string::String,
pub enabled: bool,
pub action: std::option::Option<crate::model::TriggerAction>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub etag: std::string::String,
pub guardrail_type: std::option::Option<crate::model::guardrail::GuardrailType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Guardrail {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enabled = v.into();
self
}
pub fn set_action<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TriggerAction>,
{
self.action = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_action<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TriggerAction>,
{
self.action = v.map(|x| x.into());
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_guardrail_type<
T: std::convert::Into<std::option::Option<crate::model::guardrail::GuardrailType>>,
>(
mut self,
v: T,
) -> Self {
self.guardrail_type = v.into();
self
}
pub fn content_filter(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::guardrail::ContentFilter>> {
#[allow(unreachable_patterns)]
self.guardrail_type.as_ref().and_then(|v| match v {
crate::model::guardrail::GuardrailType::ContentFilter(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_content_filter<
T: std::convert::Into<std::boxed::Box<crate::model::guardrail::ContentFilter>>,
>(
mut self,
v: T,
) -> Self {
self.guardrail_type = std::option::Option::Some(
crate::model::guardrail::GuardrailType::ContentFilter(v.into()),
);
self
}
pub fn llm_prompt_security(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::guardrail::LlmPromptSecurity>> {
#[allow(unreachable_patterns)]
self.guardrail_type.as_ref().and_then(|v| match v {
crate::model::guardrail::GuardrailType::LlmPromptSecurity(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_llm_prompt_security<
T: std::convert::Into<std::boxed::Box<crate::model::guardrail::LlmPromptSecurity>>,
>(
mut self,
v: T,
) -> Self {
self.guardrail_type = std::option::Option::Some(
crate::model::guardrail::GuardrailType::LlmPromptSecurity(v.into()),
);
self
}
pub fn llm_policy(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::guardrail::LlmPolicy>> {
#[allow(unreachable_patterns)]
self.guardrail_type.as_ref().and_then(|v| match v {
crate::model::guardrail::GuardrailType::LlmPolicy(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_llm_policy<
T: std::convert::Into<std::boxed::Box<crate::model::guardrail::LlmPolicy>>,
>(
mut self,
v: T,
) -> Self {
self.guardrail_type =
std::option::Option::Some(crate::model::guardrail::GuardrailType::LlmPolicy(v.into()));
self
}
pub fn model_safety(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::guardrail::ModelSafety>> {
#[allow(unreachable_patterns)]
self.guardrail_type.as_ref().and_then(|v| match v {
crate::model::guardrail::GuardrailType::ModelSafety(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_model_safety<
T: std::convert::Into<std::boxed::Box<crate::model::guardrail::ModelSafety>>,
>(
mut self,
v: T,
) -> Self {
self.guardrail_type = std::option::Option::Some(
crate::model::guardrail::GuardrailType::ModelSafety(v.into()),
);
self
}
pub fn code_callback(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::guardrail::CodeCallback>> {
#[allow(unreachable_patterns)]
self.guardrail_type.as_ref().and_then(|v| match v {
crate::model::guardrail::GuardrailType::CodeCallback(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_code_callback<
T: std::convert::Into<std::boxed::Box<crate::model::guardrail::CodeCallback>>,
>(
mut self,
v: T,
) -> Self {
self.guardrail_type = std::option::Option::Some(
crate::model::guardrail::GuardrailType::CodeCallback(v.into()),
);
self
}
}
impl wkt::message::Message for Guardrail {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Guardrail"
}
}
pub mod guardrail {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ContentFilter {
pub banned_contents: std::vec::Vec<std::string::String>,
pub banned_contents_in_user_input: std::vec::Vec<std::string::String>,
pub banned_contents_in_agent_response: std::vec::Vec<std::string::String>,
pub match_type: crate::model::guardrail::content_filter::MatchType,
pub disregard_diacritics: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ContentFilter {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_banned_contents<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.banned_contents = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_banned_contents_in_user_input<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.banned_contents_in_user_input = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_banned_contents_in_agent_response<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.banned_contents_in_agent_response = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_match_type<
T: std::convert::Into<crate::model::guardrail::content_filter::MatchType>,
>(
mut self,
v: T,
) -> Self {
self.match_type = v.into();
self
}
pub fn set_disregard_diacritics<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disregard_diacritics = v.into();
self
}
}
impl wkt::message::Message for ContentFilter {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Guardrail.ContentFilter"
}
}
pub mod content_filter {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum MatchType {
Unspecified,
SimpleStringMatch,
WordBoundaryStringMatch,
RegexpMatch,
UnknownValue(match_type::UnknownValue),
}
#[doc(hidden)]
pub mod match_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl MatchType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::SimpleStringMatch => std::option::Option::Some(1),
Self::WordBoundaryStringMatch => std::option::Option::Some(2),
Self::RegexpMatch => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("MATCH_TYPE_UNSPECIFIED"),
Self::SimpleStringMatch => std::option::Option::Some("SIMPLE_STRING_MATCH"),
Self::WordBoundaryStringMatch => {
std::option::Option::Some("WORD_BOUNDARY_STRING_MATCH")
}
Self::RegexpMatch => std::option::Option::Some("REGEXP_MATCH"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for MatchType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for MatchType {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for MatchType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::SimpleStringMatch,
2 => Self::WordBoundaryStringMatch,
3 => Self::RegexpMatch,
_ => Self::UnknownValue(match_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for MatchType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MATCH_TYPE_UNSPECIFIED" => Self::Unspecified,
"SIMPLE_STRING_MATCH" => Self::SimpleStringMatch,
"WORD_BOUNDARY_STRING_MATCH" => Self::WordBoundaryStringMatch,
"REGEXP_MATCH" => Self::RegexpMatch,
_ => Self::UnknownValue(match_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for MatchType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::SimpleStringMatch => serializer.serialize_i32(1),
Self::WordBoundaryStringMatch => serializer.serialize_i32(2),
Self::RegexpMatch => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for MatchType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<MatchType>::new(
".google.cloud.ces.v1.Guardrail.ContentFilter.MatchType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LlmPromptSecurity {
pub fail_open: bool,
pub security_config:
std::option::Option<crate::model::guardrail::llm_prompt_security::SecurityConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LlmPromptSecurity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_fail_open<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.fail_open = v.into();
self
}
pub fn set_security_config<
T: std::convert::Into<
std::option::Option<
crate::model::guardrail::llm_prompt_security::SecurityConfig,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.security_config = v.into();
self
}
pub fn default_settings(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::guardrail::llm_prompt_security::DefaultSecuritySettings>,
> {
#[allow(unreachable_patterns)]
self.security_config.as_ref().and_then(|v| match v {
crate::model::guardrail::llm_prompt_security::SecurityConfig::DefaultSettings(
v,
) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_default_settings<
T: std::convert::Into<
std::boxed::Box<
crate::model::guardrail::llm_prompt_security::DefaultSecuritySettings,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.security_config = std::option::Option::Some(
crate::model::guardrail::llm_prompt_security::SecurityConfig::DefaultSettings(
v.into(),
),
);
self
}
pub fn custom_policy(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::guardrail::LlmPolicy>> {
#[allow(unreachable_patterns)]
self.security_config.as_ref().and_then(|v| match v {
crate::model::guardrail::llm_prompt_security::SecurityConfig::CustomPolicy(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_custom_policy<
T: std::convert::Into<std::boxed::Box<crate::model::guardrail::LlmPolicy>>,
>(
mut self,
v: T,
) -> Self {
self.security_config = std::option::Option::Some(
crate::model::guardrail::llm_prompt_security::SecurityConfig::CustomPolicy(
v.into(),
),
);
self
}
}
impl wkt::message::Message for LlmPromptSecurity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Guardrail.LlmPromptSecurity"
}
}
pub mod llm_prompt_security {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DefaultSecuritySettings {
pub default_prompt_template: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DefaultSecuritySettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_default_prompt_template<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.default_prompt_template = v.into();
self
}
}
impl wkt::message::Message for DefaultSecuritySettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SecurityConfig {
DefaultSettings(
std::boxed::Box<
crate::model::guardrail::llm_prompt_security::DefaultSecuritySettings,
>,
),
CustomPolicy(std::boxed::Box<crate::model::guardrail::LlmPolicy>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LlmPolicy {
pub max_conversation_messages: i32,
pub model_settings: std::option::Option<crate::model::ModelSettings>,
pub prompt: std::string::String,
pub policy_scope: crate::model::guardrail::llm_policy::PolicyScope,
pub fail_open: bool,
pub allow_short_utterance: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LlmPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_max_conversation_messages<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.max_conversation_messages = v.into();
self
}
pub fn set_model_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ModelSettings>,
{
self.model_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_model_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ModelSettings>,
{
self.model_settings = v.map(|x| x.into());
self
}
pub fn set_prompt<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.prompt = v.into();
self
}
pub fn set_policy_scope<
T: std::convert::Into<crate::model::guardrail::llm_policy::PolicyScope>,
>(
mut self,
v: T,
) -> Self {
self.policy_scope = v.into();
self
}
pub fn set_fail_open<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.fail_open = v.into();
self
}
pub fn set_allow_short_utterance<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_short_utterance = v.into();
self
}
}
impl wkt::message::Message for LlmPolicy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Guardrail.LlmPolicy"
}
}
pub mod llm_policy {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PolicyScope {
Unspecified,
UserQuery,
AgentResponse,
UserQueryAndAgentResponse,
UnknownValue(policy_scope::UnknownValue),
}
#[doc(hidden)]
pub mod policy_scope {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PolicyScope {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::UserQuery => std::option::Option::Some(1),
Self::AgentResponse => std::option::Option::Some(2),
Self::UserQueryAndAgentResponse => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("POLICY_SCOPE_UNSPECIFIED"),
Self::UserQuery => std::option::Option::Some("USER_QUERY"),
Self::AgentResponse => std::option::Option::Some("AGENT_RESPONSE"),
Self::UserQueryAndAgentResponse => {
std::option::Option::Some("USER_QUERY_AND_AGENT_RESPONSE")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PolicyScope {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PolicyScope {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for PolicyScope {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::UserQuery,
2 => Self::AgentResponse,
3 => Self::UserQueryAndAgentResponse,
_ => Self::UnknownValue(policy_scope::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PolicyScope {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"POLICY_SCOPE_UNSPECIFIED" => Self::Unspecified,
"USER_QUERY" => Self::UserQuery,
"AGENT_RESPONSE" => Self::AgentResponse,
"USER_QUERY_AND_AGENT_RESPONSE" => Self::UserQueryAndAgentResponse,
_ => Self::UnknownValue(policy_scope::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PolicyScope {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::UserQuery => serializer.serialize_i32(1),
Self::AgentResponse => serializer.serialize_i32(2),
Self::UserQueryAndAgentResponse => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PolicyScope {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyScope>::new(
".google.cloud.ces.v1.Guardrail.LlmPolicy.PolicyScope",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ModelSafety {
pub safety_settings: std::vec::Vec<crate::model::guardrail::model_safety::SafetySetting>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ModelSafety {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_safety_settings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::guardrail::model_safety::SafetySetting>,
{
use std::iter::Iterator;
self.safety_settings = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ModelSafety {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Guardrail.ModelSafety"
}
}
pub mod model_safety {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SafetySetting {
pub category: crate::model::guardrail::model_safety::HarmCategory,
pub threshold: crate::model::guardrail::model_safety::HarmBlockThreshold,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SafetySetting {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_category<
T: std::convert::Into<crate::model::guardrail::model_safety::HarmCategory>,
>(
mut self,
v: T,
) -> Self {
self.category = v.into();
self
}
pub fn set_threshold<
T: std::convert::Into<crate::model::guardrail::model_safety::HarmBlockThreshold>,
>(
mut self,
v: T,
) -> Self {
self.threshold = v.into();
self
}
}
impl wkt::message::Message for SafetySetting {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum HarmCategory {
Unspecified,
HateSpeech,
DangerousContent,
Harassment,
SexuallyExplicit,
UnknownValue(harm_category::UnknownValue),
}
#[doc(hidden)]
pub mod harm_category {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl HarmCategory {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::HateSpeech => std::option::Option::Some(1),
Self::DangerousContent => std::option::Option::Some(2),
Self::Harassment => std::option::Option::Some(3),
Self::SexuallyExplicit => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("HARM_CATEGORY_UNSPECIFIED"),
Self::HateSpeech => std::option::Option::Some("HARM_CATEGORY_HATE_SPEECH"),
Self::DangerousContent => {
std::option::Option::Some("HARM_CATEGORY_DANGEROUS_CONTENT")
}
Self::Harassment => std::option::Option::Some("HARM_CATEGORY_HARASSMENT"),
Self::SexuallyExplicit => {
std::option::Option::Some("HARM_CATEGORY_SEXUALLY_EXPLICIT")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for HarmCategory {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for HarmCategory {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for HarmCategory {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::HateSpeech,
2 => Self::DangerousContent,
3 => Self::Harassment,
4 => Self::SexuallyExplicit,
_ => Self::UnknownValue(harm_category::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for HarmCategory {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"HARM_CATEGORY_UNSPECIFIED" => Self::Unspecified,
"HARM_CATEGORY_HATE_SPEECH" => Self::HateSpeech,
"HARM_CATEGORY_DANGEROUS_CONTENT" => Self::DangerousContent,
"HARM_CATEGORY_HARASSMENT" => Self::Harassment,
"HARM_CATEGORY_SEXUALLY_EXPLICIT" => Self::SexuallyExplicit,
_ => Self::UnknownValue(harm_category::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for HarmCategory {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::HateSpeech => serializer.serialize_i32(1),
Self::DangerousContent => serializer.serialize_i32(2),
Self::Harassment => serializer.serialize_i32(3),
Self::SexuallyExplicit => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for HarmCategory {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<HarmCategory>::new(
".google.cloud.ces.v1.Guardrail.ModelSafety.HarmCategory",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum HarmBlockThreshold {
Unspecified,
BlockLowAndAbove,
BlockMediumAndAbove,
BlockOnlyHigh,
BlockNone,
Off,
UnknownValue(harm_block_threshold::UnknownValue),
}
#[doc(hidden)]
pub mod harm_block_threshold {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl HarmBlockThreshold {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::BlockLowAndAbove => std::option::Option::Some(1),
Self::BlockMediumAndAbove => std::option::Option::Some(2),
Self::BlockOnlyHigh => std::option::Option::Some(3),
Self::BlockNone => std::option::Option::Some(4),
Self::Off => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("HARM_BLOCK_THRESHOLD_UNSPECIFIED")
}
Self::BlockLowAndAbove => std::option::Option::Some("BLOCK_LOW_AND_ABOVE"),
Self::BlockMediumAndAbove => {
std::option::Option::Some("BLOCK_MEDIUM_AND_ABOVE")
}
Self::BlockOnlyHigh => std::option::Option::Some("BLOCK_ONLY_HIGH"),
Self::BlockNone => std::option::Option::Some("BLOCK_NONE"),
Self::Off => std::option::Option::Some("OFF"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for HarmBlockThreshold {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for HarmBlockThreshold {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for HarmBlockThreshold {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::BlockLowAndAbove,
2 => Self::BlockMediumAndAbove,
3 => Self::BlockOnlyHigh,
4 => Self::BlockNone,
5 => Self::Off,
_ => Self::UnknownValue(harm_block_threshold::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for HarmBlockThreshold {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"HARM_BLOCK_THRESHOLD_UNSPECIFIED" => Self::Unspecified,
"BLOCK_LOW_AND_ABOVE" => Self::BlockLowAndAbove,
"BLOCK_MEDIUM_AND_ABOVE" => Self::BlockMediumAndAbove,
"BLOCK_ONLY_HIGH" => Self::BlockOnlyHigh,
"BLOCK_NONE" => Self::BlockNone,
"OFF" => Self::Off,
_ => Self::UnknownValue(harm_block_threshold::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for HarmBlockThreshold {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::BlockLowAndAbove => serializer.serialize_i32(1),
Self::BlockMediumAndAbove => serializer.serialize_i32(2),
Self::BlockOnlyHigh => serializer.serialize_i32(3),
Self::BlockNone => serializer.serialize_i32(4),
Self::Off => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for HarmBlockThreshold {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<HarmBlockThreshold>::new(
".google.cloud.ces.v1.Guardrail.ModelSafety.HarmBlockThreshold",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CodeCallback {
pub before_agent_callback: std::option::Option<crate::model::Callback>,
pub after_agent_callback: std::option::Option<crate::model::Callback>,
pub before_model_callback: std::option::Option<crate::model::Callback>,
pub after_model_callback: std::option::Option<crate::model::Callback>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CodeCallback {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_before_agent_callback<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Callback>,
{
self.before_agent_callback = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_before_agent_callback<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Callback>,
{
self.before_agent_callback = v.map(|x| x.into());
self
}
pub fn set_after_agent_callback<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Callback>,
{
self.after_agent_callback = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_after_agent_callback<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Callback>,
{
self.after_agent_callback = v.map(|x| x.into());
self
}
pub fn set_before_model_callback<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Callback>,
{
self.before_model_callback = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_before_model_callback<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Callback>,
{
self.before_model_callback = v.map(|x| x.into());
self
}
pub fn set_after_model_callback<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Callback>,
{
self.after_model_callback = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_after_model_callback<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Callback>,
{
self.after_model_callback = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CodeCallback {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Guardrail.CodeCallback"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum GuardrailType {
ContentFilter(std::boxed::Box<crate::model::guardrail::ContentFilter>),
LlmPromptSecurity(std::boxed::Box<crate::model::guardrail::LlmPromptSecurity>),
LlmPolicy(std::boxed::Box<crate::model::guardrail::LlmPolicy>),
ModelSafety(std::boxed::Box<crate::model::guardrail::ModelSafety>),
CodeCallback(std::boxed::Box<crate::model::guardrail::CodeCallback>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct McpTool {
pub name: std::string::String,
pub name_override: std::string::String,
pub description: std::string::String,
pub input_schema: std::option::Option<crate::model::Schema>,
pub output_schema: std::option::Option<crate::model::Schema>,
pub server_address: std::string::String,
pub api_authentication: std::option::Option<crate::model::ApiAuthentication>,
pub tls_config: std::option::Option<crate::model::TlsConfig>,
pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
pub custom_headers: std::collections::HashMap<std::string::String, std::string::String>,
pub state: crate::model::mcp_tool::State,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl McpTool {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_name_override<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name_override = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_input_schema<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.input_schema = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_input_schema<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.input_schema = v.map(|x| x.into());
self
}
pub fn set_output_schema<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.output_schema = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_output_schema<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.output_schema = v.map(|x| x.into());
self
}
pub fn set_server_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.server_address = v.into();
self
}
pub fn set_api_authentication<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ApiAuthentication>,
{
self.api_authentication = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_api_authentication<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ApiAuthentication>,
{
self.api_authentication = v.map(|x| x.into());
self
}
pub fn set_tls_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TlsConfig>,
{
self.tls_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tls_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TlsConfig>,
{
self.tls_config = v.map(|x| x.into());
self
}
pub fn set_service_directory_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
{
self.service_directory_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
{
self.service_directory_config = v.map(|x| x.into());
self
}
pub fn set_custom_headers<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.custom_headers = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_state<T: std::convert::Into<crate::model::mcp_tool::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
}
impl wkt::message::Message for McpTool {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.McpTool"
}
}
pub mod mcp_tool {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Active,
Inactive,
Stale,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Active => std::option::Option::Some(1),
Self::Inactive => std::option::Option::Some(2),
Self::Stale => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::Inactive => std::option::Option::Some("INACTIVE"),
Self::Stale => std::option::Option::Some("STALE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Active,
2 => Self::Inactive,
3 => Self::Stale,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"ACTIVE" => Self::Active,
"INACTIVE" => Self::Inactive,
"STALE" => Self::Stale,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Active => serializer.serialize_i32(1),
Self::Inactive => serializer.serialize_i32(2),
Self::Stale => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.ces.v1.McpTool.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct McpToolset {
pub server_address: std::string::String,
pub api_authentication: std::option::Option<crate::model::ApiAuthentication>,
pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
pub tls_config: std::option::Option<crate::model::TlsConfig>,
pub custom_headers: std::collections::HashMap<std::string::String, std::string::String>,
pub tool_overrides: std::vec::Vec<crate::model::McpToolOverride>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl McpToolset {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_server_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.server_address = v.into();
self
}
pub fn set_api_authentication<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ApiAuthentication>,
{
self.api_authentication = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_api_authentication<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ApiAuthentication>,
{
self.api_authentication = v.map(|x| x.into());
self
}
pub fn set_service_directory_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
{
self.service_directory_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
{
self.service_directory_config = v.map(|x| x.into());
self
}
pub fn set_tls_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TlsConfig>,
{
self.tls_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tls_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TlsConfig>,
{
self.tls_config = v.map(|x| x.into());
self
}
pub fn set_custom_headers<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.custom_headers = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_tool_overrides<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::McpToolOverride>,
{
use std::iter::Iterator;
self.tool_overrides = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for McpToolset {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.McpToolset"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct McpToolOverride {
pub tool: std::string::String,
pub name_override: std::string::String,
pub description_override: std::string::String,
pub snapshot: std::option::Option<crate::model::McpToolDefinition>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl McpToolOverride {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tool = v.into();
self
}
pub fn set_name_override<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name_override = v.into();
self
}
pub fn set_description_override<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.description_override = v.into();
self
}
pub fn set_snapshot<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::McpToolDefinition>,
{
self.snapshot = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::McpToolDefinition>,
{
self.snapshot = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for McpToolOverride {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.McpToolOverride"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct McpToolDefinition {
pub description: std::string::String,
pub input_schema: std::option::Option<crate::model::Schema>,
pub output_schema: std::option::Option<crate::model::Schema>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl McpToolDefinition {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_input_schema<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.input_schema = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_input_schema<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.input_schema = v.map(|x| x.into());
self
}
pub fn set_output_schema<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.output_schema = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_output_schema<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.output_schema = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for McpToolDefinition {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.McpToolDefinition"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MockedToolCall {
#[deprecated]
pub tool: std::string::String,
pub expected_args_pattern: std::option::Option<wkt::Struct>,
pub mock_response: std::option::Option<wkt::Struct>,
pub tool_identifier: std::option::Option<crate::model::mocked_tool_call::ToolIdentifier>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MockedToolCall {
pub fn new() -> Self {
std::default::Default::default()
}
#[deprecated]
pub fn set_tool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tool = v.into();
self
}
pub fn set_expected_args_pattern<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.expected_args_pattern = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_expected_args_pattern<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.expected_args_pattern = v.map(|x| x.into());
self
}
pub fn set_mock_response<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.mock_response = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_mock_response<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.mock_response = v.map(|x| x.into());
self
}
pub fn set_tool_identifier<
T: std::convert::Into<std::option::Option<crate::model::mocked_tool_call::ToolIdentifier>>,
>(
mut self,
v: T,
) -> Self {
self.tool_identifier = v.into();
self
}
pub fn tool_id(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.tool_identifier.as_ref().and_then(|v| match v {
crate::model::mocked_tool_call::ToolIdentifier::ToolId(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_tool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tool_identifier = std::option::Option::Some(
crate::model::mocked_tool_call::ToolIdentifier::ToolId(v.into()),
);
self
}
pub fn toolset(&self) -> std::option::Option<&std::boxed::Box<crate::model::ToolsetTool>> {
#[allow(unreachable_patterns)]
self.tool_identifier.as_ref().and_then(|v| match v {
crate::model::mocked_tool_call::ToolIdentifier::Toolset(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_toolset<T: std::convert::Into<std::boxed::Box<crate::model::ToolsetTool>>>(
mut self,
v: T,
) -> Self {
self.tool_identifier = std::option::Option::Some(
crate::model::mocked_tool_call::ToolIdentifier::Toolset(v.into()),
);
self
}
}
impl wkt::message::Message for MockedToolCall {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.MockedToolCall"
}
}
pub mod mocked_tool_call {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ToolIdentifier {
ToolId(std::string::String),
Toolset(std::boxed::Box<crate::model::ToolsetTool>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Omnichannel {
pub name: std::string::String,
pub display_name: std::string::String,
pub description: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub etag: std::string::String,
pub integration_config: std::option::Option<crate::model::OmnichannelIntegrationConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Omnichannel {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_integration_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::OmnichannelIntegrationConfig>,
{
self.integration_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_integration_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::OmnichannelIntegrationConfig>,
{
self.integration_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Omnichannel {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Omnichannel"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OmnichannelIntegrationConfig {
pub channel_configs: std::collections::HashMap<
std::string::String,
crate::model::omnichannel_integration_config::ChannelConfig,
>,
pub subscriber_configs: std::collections::HashMap<
std::string::String,
crate::model::omnichannel_integration_config::SubscriberConfig,
>,
pub routing_configs: std::collections::HashMap<
std::string::String,
crate::model::omnichannel_integration_config::RoutingConfig,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OmnichannelIntegrationConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_channel_configs<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::omnichannel_integration_config::ChannelConfig>,
{
use std::iter::Iterator;
self.channel_configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_subscriber_configs<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::omnichannel_integration_config::SubscriberConfig>,
{
use std::iter::Iterator;
self.subscriber_configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_routing_configs<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::omnichannel_integration_config::RoutingConfig>,
{
use std::iter::Iterator;
self.routing_configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for OmnichannelIntegrationConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.OmnichannelIntegrationConfig"
}
}
pub mod omnichannel_integration_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ChannelConfig {
pub channel_config: std::option::Option<
crate::model::omnichannel_integration_config::channel_config::ChannelConfig,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ChannelConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_channel_config<
T: std::convert::Into<
std::option::Option<
crate::model::omnichannel_integration_config::channel_config::ChannelConfig,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.channel_config = v.into();
self
}
pub fn whatsapp_config(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::omnichannel_integration_config::WhatsappConfig>,
> {
#[allow(unreachable_patterns)]
self.channel_config.as_ref().and_then(|v| match v {
crate::model::omnichannel_integration_config::channel_config::ChannelConfig::WhatsappConfig(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_whatsapp_config<
T: std::convert::Into<
std::boxed::Box<crate::model::omnichannel_integration_config::WhatsappConfig>,
>,
>(
mut self,
v: T,
) -> Self {
self.channel_config = std::option::Option::Some(
crate::model::omnichannel_integration_config::channel_config::ChannelConfig::WhatsappConfig(
v.into()
)
);
self
}
}
impl wkt::message::Message for ChannelConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig"
}
}
pub mod channel_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ChannelConfig {
WhatsappConfig(
std::boxed::Box<crate::model::omnichannel_integration_config::WhatsappConfig>,
),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WhatsappConfig {
pub phone_number_id: std::string::String,
pub phone_number: std::string::String,
pub whatsapp_business_account_id: std::string::String,
pub webhook_verify_token: std::string::String,
pub whatsapp_business_token: std::string::String,
pub meta_business_portfolio_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WhatsappConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_phone_number_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.phone_number_id = v.into();
self
}
pub fn set_phone_number<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.phone_number = v.into();
self
}
pub fn set_whatsapp_business_account_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.whatsapp_business_account_id = v.into();
self
}
pub fn set_webhook_verify_token<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.webhook_verify_token = v.into();
self
}
pub fn set_whatsapp_business_token<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.whatsapp_business_token = v.into();
self
}
pub fn set_meta_business_portfolio_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.meta_business_portfolio_id = v.into();
self
}
}
impl wkt::message::Message for WhatsappConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SubscriberConfig {
pub subscriber_config: std::option::Option<
crate::model::omnichannel_integration_config::subscriber_config::SubscriberConfig,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SubscriberConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_subscriber_config<T: std::convert::Into<std::option::Option<crate::model::omnichannel_integration_config::subscriber_config::SubscriberConfig>>>(mut self, v: T) -> Self
{
self.subscriber_config = v.into();
self
}
pub fn ces_app_config(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::omnichannel_integration_config::CesAppConfig>,
> {
#[allow(unreachable_patterns)]
self.subscriber_config.as_ref().and_then(|v| match v {
crate::model::omnichannel_integration_config::subscriber_config::SubscriberConfig::CesAppConfig(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_ces_app_config<
T: std::convert::Into<
std::boxed::Box<crate::model::omnichannel_integration_config::CesAppConfig>,
>,
>(
mut self,
v: T,
) -> Self {
self.subscriber_config = std::option::Option::Some(
crate::model::omnichannel_integration_config::subscriber_config::SubscriberConfig::CesAppConfig(
v.into()
)
);
self
}
}
impl wkt::message::Message for SubscriberConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig"
}
}
pub mod subscriber_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SubscriberConfig {
CesAppConfig(
std::boxed::Box<crate::model::omnichannel_integration_config::CesAppConfig>,
),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CesAppConfig {
pub app: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CesAppConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_app<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.app = v.into();
self
}
}
impl wkt::message::Message for CesAppConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RoutingConfig {
pub subscriber_key: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RoutingConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_subscriber_key<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.subscriber_key = v.into();
self
}
}
impl wkt::message::Message for RoutingConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OmnichannelOperationMetadata {
pub create_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub status_message: std::string::String,
pub requested_cancellation: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OmnichannelOperationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.status_message = v.into();
self
}
pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.requested_cancellation = v.into();
self
}
}
impl wkt::message::Message for OmnichannelOperationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.OmnichannelOperationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OpenApiTool {
pub open_api_schema: std::string::String,
pub name: std::string::String,
pub description: std::string::String,
pub api_authentication: std::option::Option<crate::model::ApiAuthentication>,
pub tls_config: std::option::Option<crate::model::TlsConfig>,
pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
pub ignore_unknown_fields: bool,
pub url: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OpenApiTool {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_open_api_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.open_api_schema = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_api_authentication<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ApiAuthentication>,
{
self.api_authentication = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_api_authentication<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ApiAuthentication>,
{
self.api_authentication = v.map(|x| x.into());
self
}
pub fn set_tls_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TlsConfig>,
{
self.tls_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tls_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TlsConfig>,
{
self.tls_config = v.map(|x| x.into());
self
}
pub fn set_service_directory_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
{
self.service_directory_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
{
self.service_directory_config = v.map(|x| x.into());
self
}
pub fn set_ignore_unknown_fields<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ignore_unknown_fields = v.into();
self
}
pub fn set_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.url = v.into();
self
}
}
impl wkt::message::Message for OpenApiTool {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.OpenApiTool"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OpenApiToolset {
pub open_api_schema: std::string::String,
pub api_authentication: std::option::Option<crate::model::ApiAuthentication>,
pub tls_config: std::option::Option<crate::model::TlsConfig>,
pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
pub ignore_unknown_fields: bool,
pub url: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OpenApiToolset {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_open_api_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.open_api_schema = v.into();
self
}
pub fn set_api_authentication<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ApiAuthentication>,
{
self.api_authentication = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_api_authentication<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ApiAuthentication>,
{
self.api_authentication = v.map(|x| x.into());
self
}
pub fn set_tls_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TlsConfig>,
{
self.tls_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tls_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TlsConfig>,
{
self.tls_config = v.map(|x| x.into());
self
}
pub fn set_service_directory_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
{
self.service_directory_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
{
self.service_directory_config = v.map(|x| x.into());
self
}
pub fn set_ignore_unknown_fields<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ignore_unknown_fields = v.into();
self
}
pub fn set_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.url = v.into();
self
}
}
impl wkt::message::Message for OpenApiToolset {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.OpenApiToolset"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PythonFunction {
pub name: std::string::String,
pub python_code: std::string::String,
pub description: std::string::String,
pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PythonFunction {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_python_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.python_code = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_service_directory_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
{
self.service_directory_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
{
self.service_directory_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PythonFunction {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.PythonFunction"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Schema {
pub r#type: crate::model::schema::Type,
pub properties: std::collections::HashMap<std::string::String, crate::model::Schema>,
pub required: std::vec::Vec<std::string::String>,
pub description: std::string::String,
pub items: std::option::Option<std::boxed::Box<crate::model::Schema>>,
pub nullable: bool,
pub unique_items: bool,
pub prefix_items: std::vec::Vec<crate::model::Schema>,
pub additional_properties: std::option::Option<std::boxed::Box<crate::model::Schema>>,
pub any_of: std::vec::Vec<crate::model::Schema>,
pub r#enum: std::vec::Vec<std::string::String>,
pub default: std::option::Option<wkt::Value>,
pub r#ref: std::string::String,
pub defs: std::collections::HashMap<std::string::String, crate::model::Schema>,
pub title: std::string::String,
pub min_items: i64,
pub max_items: i64,
pub minimum: std::option::Option<f64>,
pub maximum: std::option::Option<f64>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Schema {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<T: std::convert::Into<crate::model::schema::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_properties<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::Schema>,
{
use std::iter::Iterator;
self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_required<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.required = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_items<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.items = std::option::Option::Some(std::boxed::Box::new(v.into()));
self
}
pub fn set_or_clear_items<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.items = v.map(|x| std::boxed::Box::new(x.into()));
self
}
pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.nullable = v.into();
self
}
pub fn set_unique_items<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.unique_items = v.into();
self
}
pub fn set_prefix_items<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Schema>,
{
use std::iter::Iterator;
self.prefix_items = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_additional_properties<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.additional_properties = std::option::Option::Some(std::boxed::Box::new(v.into()));
self
}
pub fn set_or_clear_additional_properties<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.additional_properties = v.map(|x| std::boxed::Box::new(x.into()));
self
}
pub fn set_any_of<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Schema>,
{
use std::iter::Iterator;
self.any_of = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_enum<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.r#enum = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_default<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Value>,
{
self.default = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_default<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Value>,
{
self.default = v.map(|x| x.into());
self
}
pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#ref = v.into();
self
}
pub fn set_defs<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::Schema>,
{
use std::iter::Iterator;
self.defs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_title<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.title = v.into();
self
}
pub fn set_min_items<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.min_items = v.into();
self
}
pub fn set_max_items<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.max_items = v.into();
self
}
pub fn set_minimum<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f64>,
{
self.minimum = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_minimum<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<f64>,
{
self.minimum = v.map(|x| x.into());
self
}
pub fn set_maximum<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f64>,
{
self.maximum = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_maximum<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<f64>,
{
self.maximum = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Schema {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Schema"
}
}
pub mod schema {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
String,
Integer,
Number,
Boolean,
Object,
Array,
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::String => std::option::Option::Some(1),
Self::Integer => std::option::Option::Some(2),
Self::Number => std::option::Option::Some(3),
Self::Boolean => std::option::Option::Some(4),
Self::Object => std::option::Option::Some(5),
Self::Array => std::option::Option::Some(6),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::String => std::option::Option::Some("STRING"),
Self::Integer => std::option::Option::Some("INTEGER"),
Self::Number => std::option::Option::Some("NUMBER"),
Self::Boolean => std::option::Option::Some("BOOLEAN"),
Self::Object => std::option::Option::Some("OBJECT"),
Self::Array => std::option::Option::Some("ARRAY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::String,
2 => Self::Integer,
3 => Self::Number,
4 => Self::Boolean,
5 => Self::Object,
6 => Self::Array,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"STRING" => Self::String,
"INTEGER" => Self::Integer,
"NUMBER" => Self::Number,
"BOOLEAN" => Self::Boolean,
"OBJECT" => Self::Object,
"ARRAY" => Self::Array,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::String => serializer.serialize_i32(1),
Self::Integer => serializer.serialize_i32(2),
Self::Number => serializer.serialize_i32(3),
Self::Boolean => serializer.serialize_i32(4),
Self::Object => serializer.serialize_i32(5),
Self::Array => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.ces.v1.Schema.Type",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GoogleSearchSuggestions {
pub htmls: std::vec::Vec<std::string::String>,
pub web_search_queries: std::vec::Vec<crate::model::WebSearchQuery>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GoogleSearchSuggestions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_htmls<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.htmls = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_web_search_queries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::WebSearchQuery>,
{
use std::iter::Iterator;
self.web_search_queries = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for GoogleSearchSuggestions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.GoogleSearchSuggestions"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WebSearchQuery {
pub query: std::string::String,
pub uri: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WebSearchQuery {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.query = v.into();
self
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
}
impl wkt::message::Message for WebSearchQuery {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.WebSearchQuery"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SecuritySettings {
pub name: std::string::String,
pub endpoint_control_policy: std::option::Option<crate::model::EndpointControlPolicy>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SecuritySettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_endpoint_control_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EndpointControlPolicy>,
{
self.endpoint_control_policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_endpoint_control_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EndpointControlPolicy>,
{
self.endpoint_control_policy = v.map(|x| x.into());
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for SecuritySettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.SecuritySettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EndpointControlPolicy {
pub enforcement_scope: crate::model::endpoint_control_policy::EnforcementScope,
pub allowed_origins: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EndpointControlPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_enforcement_scope<
T: std::convert::Into<crate::model::endpoint_control_policy::EnforcementScope>,
>(
mut self,
v: T,
) -> Self {
self.enforcement_scope = v.into();
self
}
pub fn set_allowed_origins<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.allowed_origins = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for EndpointControlPolicy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.EndpointControlPolicy"
}
}
pub mod endpoint_control_policy {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EnforcementScope {
Unspecified,
VpcscOnly,
Always,
UnknownValue(enforcement_scope::UnknownValue),
}
#[doc(hidden)]
pub mod enforcement_scope {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EnforcementScope {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::VpcscOnly => std::option::Option::Some(1),
Self::Always => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ENFORCEMENT_SCOPE_UNSPECIFIED"),
Self::VpcscOnly => std::option::Option::Some("VPCSC_ONLY"),
Self::Always => std::option::Option::Some("ALWAYS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EnforcementScope {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EnforcementScope {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for EnforcementScope {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::VpcscOnly,
2 => Self::Always,
_ => Self::UnknownValue(enforcement_scope::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EnforcementScope {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ENFORCEMENT_SCOPE_UNSPECIFIED" => Self::Unspecified,
"VPCSC_ONLY" => Self::VpcscOnly,
"ALWAYS" => Self::Always,
_ => Self::UnknownValue(enforcement_scope::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EnforcementScope {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::VpcscOnly => serializer.serialize_i32(1),
Self::Always => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EnforcementScope {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EnforcementScope>::new(
".google.cloud.ces.v1.EndpointControlPolicy.EnforcementScope",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MockConfig {
pub mocked_tool_calls: std::vec::Vec<crate::model::MockedToolCall>,
pub unmatched_tool_call_behavior: crate::model::mock_config::UnmatchedToolCallBehavior,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MockConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_mocked_tool_calls<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MockedToolCall>,
{
use std::iter::Iterator;
self.mocked_tool_calls = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_unmatched_tool_call_behavior<
T: std::convert::Into<crate::model::mock_config::UnmatchedToolCallBehavior>,
>(
mut self,
v: T,
) -> Self {
self.unmatched_tool_call_behavior = v.into();
self
}
}
impl wkt::message::Message for MockConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.MockConfig"
}
}
pub mod mock_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum UnmatchedToolCallBehavior {
Unspecified,
Fail,
PassThrough,
UnknownValue(unmatched_tool_call_behavior::UnknownValue),
}
#[doc(hidden)]
pub mod unmatched_tool_call_behavior {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl UnmatchedToolCallBehavior {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Fail => std::option::Option::Some(1),
Self::PassThrough => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("UNMATCHED_TOOL_CALL_BEHAVIOR_UNSPECIFIED")
}
Self::Fail => std::option::Option::Some("FAIL"),
Self::PassThrough => std::option::Option::Some("PASS_THROUGH"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for UnmatchedToolCallBehavior {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for UnmatchedToolCallBehavior {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for UnmatchedToolCallBehavior {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Fail,
2 => Self::PassThrough,
_ => Self::UnknownValue(unmatched_tool_call_behavior::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for UnmatchedToolCallBehavior {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"UNMATCHED_TOOL_CALL_BEHAVIOR_UNSPECIFIED" => Self::Unspecified,
"FAIL" => Self::Fail,
"PASS_THROUGH" => Self::PassThrough,
_ => Self::UnknownValue(unmatched_tool_call_behavior::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for UnmatchedToolCallBehavior {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Fail => serializer.serialize_i32(1),
Self::PassThrough => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for UnmatchedToolCallBehavior {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<UnmatchedToolCallBehavior>::new(
".google.cloud.ces.v1.MockConfig.UnmatchedToolCallBehavior",
),
)
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InputAudioConfig {
pub audio_encoding: crate::model::AudioEncoding,
pub sample_rate_hertz: i32,
pub noise_suppression_level: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InputAudioConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_audio_encoding<T: std::convert::Into<crate::model::AudioEncoding>>(
mut self,
v: T,
) -> Self {
self.audio_encoding = v.into();
self
}
pub fn set_sample_rate_hertz<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.sample_rate_hertz = v.into();
self
}
pub fn set_noise_suppression_level<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.noise_suppression_level = v.into();
self
}
}
impl wkt::message::Message for InputAudioConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.InputAudioConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OutputAudioConfig {
pub audio_encoding: crate::model::AudioEncoding,
pub sample_rate_hertz: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OutputAudioConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_audio_encoding<T: std::convert::Into<crate::model::AudioEncoding>>(
mut self,
v: T,
) -> Self {
self.audio_encoding = v.into();
self
}
pub fn set_sample_rate_hertz<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.sample_rate_hertz = v.into();
self
}
}
impl wkt::message::Message for OutputAudioConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.OutputAudioConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SessionConfig {
pub session: std::string::String,
pub input_audio_config: std::option::Option<crate::model::InputAudioConfig>,
pub output_audio_config: std::option::Option<crate::model::OutputAudioConfig>,
pub historical_contexts: std::vec::Vec<crate::model::Message>,
pub entry_agent: std::string::String,
pub deployment: std::string::String,
pub time_zone: std::string::String,
pub use_tool_fakes: bool,
pub remote_dialogflow_query_parameters:
std::option::Option<crate::model::session_config::RemoteDialogflowQueryParameters>,
pub enable_text_streaming: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SessionConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_session<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.session = v.into();
self
}
pub fn set_input_audio_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InputAudioConfig>,
{
self.input_audio_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_input_audio_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InputAudioConfig>,
{
self.input_audio_config = v.map(|x| x.into());
self
}
pub fn set_output_audio_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::OutputAudioConfig>,
{
self.output_audio_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_output_audio_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::OutputAudioConfig>,
{
self.output_audio_config = v.map(|x| x.into());
self
}
pub fn set_historical_contexts<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Message>,
{
use std::iter::Iterator;
self.historical_contexts = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_entry_agent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.entry_agent = v.into();
self
}
pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.deployment = v.into();
self
}
pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.time_zone = v.into();
self
}
pub fn set_use_tool_fakes<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.use_tool_fakes = v.into();
self
}
pub fn set_remote_dialogflow_query_parameters<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::session_config::RemoteDialogflowQueryParameters>,
{
self.remote_dialogflow_query_parameters = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_remote_dialogflow_query_parameters<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::session_config::RemoteDialogflowQueryParameters>,
{
self.remote_dialogflow_query_parameters = v.map(|x| x.into());
self
}
pub fn set_enable_text_streaming<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_text_streaming = v.into();
self
}
}
impl wkt::message::Message for SessionConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.SessionConfig"
}
}
pub mod session_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RemoteDialogflowQueryParameters {
pub webhook_headers: std::collections::HashMap<std::string::String, std::string::String>,
pub payload: std::option::Option<wkt::Struct>,
pub end_user_metadata: std::option::Option<wkt::Struct>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RemoteDialogflowQueryParameters {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_webhook_headers<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.webhook_headers = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_payload<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.payload = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_payload<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.payload = v.map(|x| x.into());
self
}
pub fn set_end_user_metadata<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.end_user_metadata = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_user_metadata<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.end_user_metadata = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RemoteDialogflowQueryParameters {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ToolCalls {
pub tool_calls: std::vec::Vec<crate::model::ToolCall>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ToolCalls {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tool_calls<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ToolCall>,
{
use std::iter::Iterator;
self.tool_calls = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ToolCalls {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ToolCalls"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ToolResponses {
pub tool_responses: std::vec::Vec<crate::model::ToolResponse>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ToolResponses {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tool_responses<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ToolResponse>,
{
use std::iter::Iterator;
self.tool_responses = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ToolResponses {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ToolResponses"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Citations {
pub cited_chunks: std::vec::Vec<crate::model::citations::CitedChunk>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Citations {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cited_chunks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::citations::CitedChunk>,
{
use std::iter::Iterator;
self.cited_chunks = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Citations {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Citations"
}
}
pub mod citations {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CitedChunk {
pub uri: std::string::String,
pub title: std::string::String,
pub text: std::string::String,
pub requires_attribution: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CitedChunk {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
pub fn set_title<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.title = v.into();
self
}
pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.text = v.into();
self
}
pub fn set_requires_attribution<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.requires_attribution = v.into();
self
}
}
impl wkt::message::Message for CitedChunk {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Citations.CitedChunk"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Event {
pub event: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Event {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_event<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.event = v.into();
self
}
}
impl wkt::message::Message for Event {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Event"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SessionInput {
pub will_continue: bool,
pub input_type: std::option::Option<crate::model::session_input::InputType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SessionInput {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_will_continue<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.will_continue = v.into();
self
}
pub fn set_input_type<
T: std::convert::Into<std::option::Option<crate::model::session_input::InputType>>,
>(
mut self,
v: T,
) -> Self {
self.input_type = v.into();
self
}
pub fn text(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.input_type.as_ref().and_then(|v| match v {
crate::model::session_input::InputType::Text(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.input_type =
std::option::Option::Some(crate::model::session_input::InputType::Text(v.into()));
self
}
pub fn dtmf(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.input_type.as_ref().and_then(|v| match v {
crate::model::session_input::InputType::Dtmf(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_dtmf<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.input_type =
std::option::Option::Some(crate::model::session_input::InputType::Dtmf(v.into()));
self
}
pub fn audio(&self) -> std::option::Option<&::bytes::Bytes> {
#[allow(unreachable_patterns)]
self.input_type.as_ref().and_then(|v| match v {
crate::model::session_input::InputType::Audio(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_audio<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.input_type =
std::option::Option::Some(crate::model::session_input::InputType::Audio(v.into()));
self
}
pub fn tool_responses(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ToolResponses>> {
#[allow(unreachable_patterns)]
self.input_type.as_ref().and_then(|v| match v {
crate::model::session_input::InputType::ToolResponses(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_tool_responses<
T: std::convert::Into<std::boxed::Box<crate::model::ToolResponses>>,
>(
mut self,
v: T,
) -> Self {
self.input_type = std::option::Option::Some(
crate::model::session_input::InputType::ToolResponses(v.into()),
);
self
}
pub fn image(&self) -> std::option::Option<&std::boxed::Box<crate::model::Image>> {
#[allow(unreachable_patterns)]
self.input_type.as_ref().and_then(|v| match v {
crate::model::session_input::InputType::Image(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_image<T: std::convert::Into<std::boxed::Box<crate::model::Image>>>(
mut self,
v: T,
) -> Self {
self.input_type =
std::option::Option::Some(crate::model::session_input::InputType::Image(v.into()));
self
}
pub fn blob(&self) -> std::option::Option<&std::boxed::Box<crate::model::Blob>> {
#[allow(unreachable_patterns)]
self.input_type.as_ref().and_then(|v| match v {
crate::model::session_input::InputType::Blob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_blob<T: std::convert::Into<std::boxed::Box<crate::model::Blob>>>(
mut self,
v: T,
) -> Self {
self.input_type =
std::option::Option::Some(crate::model::session_input::InputType::Blob(v.into()));
self
}
pub fn variables(&self) -> std::option::Option<&std::boxed::Box<wkt::Struct>> {
#[allow(unreachable_patterns)]
self.input_type.as_ref().and_then(|v| match v {
crate::model::session_input::InputType::Variables(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_variables<T: std::convert::Into<std::boxed::Box<wkt::Struct>>>(
mut self,
v: T,
) -> Self {
self.input_type =
std::option::Option::Some(crate::model::session_input::InputType::Variables(v.into()));
self
}
pub fn event(&self) -> std::option::Option<&std::boxed::Box<crate::model::Event>> {
#[allow(unreachable_patterns)]
self.input_type.as_ref().and_then(|v| match v {
crate::model::session_input::InputType::Event(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_event<T: std::convert::Into<std::boxed::Box<crate::model::Event>>>(
mut self,
v: T,
) -> Self {
self.input_type =
std::option::Option::Some(crate::model::session_input::InputType::Event(v.into()));
self
}
}
impl wkt::message::Message for SessionInput {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.SessionInput"
}
}
pub mod session_input {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum InputType {
Text(std::string::String),
Dtmf(std::string::String),
Audio(::bytes::Bytes),
ToolResponses(std::boxed::Box<crate::model::ToolResponses>),
Image(std::boxed::Box<crate::model::Image>),
Blob(std::boxed::Box<crate::model::Blob>),
Variables(std::boxed::Box<wkt::Struct>),
Event(std::boxed::Box<crate::model::Event>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SessionOutput {
pub turn_index: i32,
pub turn_completed: bool,
pub diagnostic_info: std::option::Option<crate::model::session_output::DiagnosticInfo>,
pub context: std::vec::Vec<wkt::Any>,
pub output_type: std::option::Option<crate::model::session_output::OutputType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SessionOutput {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_turn_index<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.turn_index = v.into();
self
}
pub fn set_turn_completed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.turn_completed = v.into();
self
}
pub fn set_diagnostic_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::session_output::DiagnosticInfo>,
{
self.diagnostic_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_diagnostic_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::session_output::DiagnosticInfo>,
{
self.diagnostic_info = v.map(|x| x.into());
self
}
pub fn set_context<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<wkt::Any>,
{
use std::iter::Iterator;
self.context = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_output_type<
T: std::convert::Into<std::option::Option<crate::model::session_output::OutputType>>,
>(
mut self,
v: T,
) -> Self {
self.output_type = v.into();
self
}
pub fn text(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.output_type.as_ref().and_then(|v| match v {
crate::model::session_output::OutputType::Text(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.output_type =
std::option::Option::Some(crate::model::session_output::OutputType::Text(v.into()));
self
}
pub fn audio(&self) -> std::option::Option<&::bytes::Bytes> {
#[allow(unreachable_patterns)]
self.output_type.as_ref().and_then(|v| match v {
crate::model::session_output::OutputType::Audio(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_audio<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.output_type =
std::option::Option::Some(crate::model::session_output::OutputType::Audio(v.into()));
self
}
pub fn tool_calls(&self) -> std::option::Option<&std::boxed::Box<crate::model::ToolCalls>> {
#[allow(unreachable_patterns)]
self.output_type.as_ref().and_then(|v| match v {
crate::model::session_output::OutputType::ToolCalls(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_tool_calls<T: std::convert::Into<std::boxed::Box<crate::model::ToolCalls>>>(
mut self,
v: T,
) -> Self {
self.output_type = std::option::Option::Some(
crate::model::session_output::OutputType::ToolCalls(v.into()),
);
self
}
pub fn citations(&self) -> std::option::Option<&std::boxed::Box<crate::model::Citations>> {
#[allow(unreachable_patterns)]
self.output_type.as_ref().and_then(|v| match v {
crate::model::session_output::OutputType::Citations(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_citations<T: std::convert::Into<std::boxed::Box<crate::model::Citations>>>(
mut self,
v: T,
) -> Self {
self.output_type = std::option::Option::Some(
crate::model::session_output::OutputType::Citations(v.into()),
);
self
}
pub fn google_search_suggestions(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::GoogleSearchSuggestions>> {
#[allow(unreachable_patterns)]
self.output_type.as_ref().and_then(|v| match v {
crate::model::session_output::OutputType::GoogleSearchSuggestions(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_google_search_suggestions<
T: std::convert::Into<std::boxed::Box<crate::model::GoogleSearchSuggestions>>,
>(
mut self,
v: T,
) -> Self {
self.output_type = std::option::Option::Some(
crate::model::session_output::OutputType::GoogleSearchSuggestions(v.into()),
);
self
}
pub fn end_session(&self) -> std::option::Option<&std::boxed::Box<crate::model::EndSession>> {
#[allow(unreachable_patterns)]
self.output_type.as_ref().and_then(|v| match v {
crate::model::session_output::OutputType::EndSession(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_end_session<T: std::convert::Into<std::boxed::Box<crate::model::EndSession>>>(
mut self,
v: T,
) -> Self {
self.output_type = std::option::Option::Some(
crate::model::session_output::OutputType::EndSession(v.into()),
);
self
}
pub fn payload(&self) -> std::option::Option<&std::boxed::Box<wkt::Struct>> {
#[allow(unreachable_patterns)]
self.output_type.as_ref().and_then(|v| match v {
crate::model::session_output::OutputType::Payload(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_payload<T: std::convert::Into<std::boxed::Box<wkt::Struct>>>(
mut self,
v: T,
) -> Self {
self.output_type =
std::option::Option::Some(crate::model::session_output::OutputType::Payload(v.into()));
self
}
}
impl wkt::message::Message for SessionOutput {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.SessionOutput"
}
}
pub mod session_output {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiagnosticInfo {
pub messages: std::vec::Vec<crate::model::Message>,
pub root_span: std::option::Option<crate::model::Span>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DiagnosticInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_messages<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Message>,
{
use std::iter::Iterator;
self.messages = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_root_span<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Span>,
{
self.root_span = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_root_span<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Span>,
{
self.root_span = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DiagnosticInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.SessionOutput.DiagnosticInfo"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum OutputType {
Text(std::string::String),
Audio(::bytes::Bytes),
ToolCalls(std::boxed::Box<crate::model::ToolCalls>),
Citations(std::boxed::Box<crate::model::Citations>),
GoogleSearchSuggestions(std::boxed::Box<crate::model::GoogleSearchSuggestions>),
EndSession(std::boxed::Box<crate::model::EndSession>),
Payload(std::boxed::Box<wkt::Struct>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RecognitionResult {
pub transcript: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RecognitionResult {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_transcript<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.transcript = v.into();
self
}
}
impl wkt::message::Message for RecognitionResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.RecognitionResult"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InterruptionSignal {
pub barge_in: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InterruptionSignal {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_barge_in<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.barge_in = v.into();
self
}
}
impl wkt::message::Message for InterruptionSignal {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.InterruptionSignal"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EndSession {
pub metadata: std::option::Option<wkt::Struct>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EndSession {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_metadata<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.metadata = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.metadata = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for EndSession {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.EndSession"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GoAway {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GoAway {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for GoAway {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.GoAway"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RunSessionRequest {
pub config: std::option::Option<crate::model::SessionConfig>,
pub inputs: std::vec::Vec<crate::model::SessionInput>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RunSessionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SessionConfig>,
{
self.config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SessionConfig>,
{
self.config = v.map(|x| x.into());
self
}
pub fn set_inputs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SessionInput>,
{
use std::iter::Iterator;
self.inputs = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RunSessionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.RunSessionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RunSessionResponse {
pub outputs: std::vec::Vec<crate::model::SessionOutput>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RunSessionResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_outputs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SessionOutput>,
{
use std::iter::Iterator;
self.outputs = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RunSessionResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.RunSessionResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BidiSessionClientMessage {
pub message_type: std::option::Option<crate::model::bidi_session_client_message::MessageType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BidiSessionClientMessage {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message_type<
T: std::convert::Into<
std::option::Option<crate::model::bidi_session_client_message::MessageType>,
>,
>(
mut self,
v: T,
) -> Self {
self.message_type = v.into();
self
}
pub fn config(&self) -> std::option::Option<&std::boxed::Box<crate::model::SessionConfig>> {
#[allow(unreachable_patterns)]
self.message_type.as_ref().and_then(|v| match v {
crate::model::bidi_session_client_message::MessageType::Config(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_config<T: std::convert::Into<std::boxed::Box<crate::model::SessionConfig>>>(
mut self,
v: T,
) -> Self {
self.message_type = std::option::Option::Some(
crate::model::bidi_session_client_message::MessageType::Config(v.into()),
);
self
}
pub fn realtime_input(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SessionInput>> {
#[allow(unreachable_patterns)]
self.message_type.as_ref().and_then(|v| match v {
crate::model::bidi_session_client_message::MessageType::RealtimeInput(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_realtime_input<
T: std::convert::Into<std::boxed::Box<crate::model::SessionInput>>,
>(
mut self,
v: T,
) -> Self {
self.message_type = std::option::Option::Some(
crate::model::bidi_session_client_message::MessageType::RealtimeInput(v.into()),
);
self
}
}
impl wkt::message::Message for BidiSessionClientMessage {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.BidiSessionClientMessage"
}
}
pub mod bidi_session_client_message {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum MessageType {
Config(std::boxed::Box<crate::model::SessionConfig>),
RealtimeInput(std::boxed::Box<crate::model::SessionInput>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BidiSessionServerMessage {
pub message_type: std::option::Option<crate::model::bidi_session_server_message::MessageType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BidiSessionServerMessage {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message_type<
T: std::convert::Into<
std::option::Option<crate::model::bidi_session_server_message::MessageType>,
>,
>(
mut self,
v: T,
) -> Self {
self.message_type = v.into();
self
}
pub fn session_output(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SessionOutput>> {
#[allow(unreachable_patterns)]
self.message_type.as_ref().and_then(|v| match v {
crate::model::bidi_session_server_message::MessageType::SessionOutput(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_session_output<
T: std::convert::Into<std::boxed::Box<crate::model::SessionOutput>>,
>(
mut self,
v: T,
) -> Self {
self.message_type = std::option::Option::Some(
crate::model::bidi_session_server_message::MessageType::SessionOutput(v.into()),
);
self
}
pub fn recognition_result(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::RecognitionResult>> {
#[allow(unreachable_patterns)]
self.message_type.as_ref().and_then(|v| match v {
crate::model::bidi_session_server_message::MessageType::RecognitionResult(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_recognition_result<
T: std::convert::Into<std::boxed::Box<crate::model::RecognitionResult>>,
>(
mut self,
v: T,
) -> Self {
self.message_type = std::option::Option::Some(
crate::model::bidi_session_server_message::MessageType::RecognitionResult(v.into()),
);
self
}
pub fn interruption_signal(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::InterruptionSignal>> {
#[allow(unreachable_patterns)]
self.message_type.as_ref().and_then(|v| match v {
crate::model::bidi_session_server_message::MessageType::InterruptionSignal(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_interruption_signal<
T: std::convert::Into<std::boxed::Box<crate::model::InterruptionSignal>>,
>(
mut self,
v: T,
) -> Self {
self.message_type = std::option::Option::Some(
crate::model::bidi_session_server_message::MessageType::InterruptionSignal(v.into()),
);
self
}
pub fn end_session(&self) -> std::option::Option<&std::boxed::Box<crate::model::EndSession>> {
#[allow(unreachable_patterns)]
self.message_type.as_ref().and_then(|v| match v {
crate::model::bidi_session_server_message::MessageType::EndSession(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_end_session<T: std::convert::Into<std::boxed::Box<crate::model::EndSession>>>(
mut self,
v: T,
) -> Self {
self.message_type = std::option::Option::Some(
crate::model::bidi_session_server_message::MessageType::EndSession(v.into()),
);
self
}
pub fn go_away(&self) -> std::option::Option<&std::boxed::Box<crate::model::GoAway>> {
#[allow(unreachable_patterns)]
self.message_type.as_ref().and_then(|v| match v {
crate::model::bidi_session_server_message::MessageType::GoAway(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_go_away<T: std::convert::Into<std::boxed::Box<crate::model::GoAway>>>(
mut self,
v: T,
) -> Self {
self.message_type = std::option::Option::Some(
crate::model::bidi_session_server_message::MessageType::GoAway(v.into()),
);
self
}
}
impl wkt::message::Message for BidiSessionServerMessage {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.BidiSessionServerMessage"
}
}
pub mod bidi_session_server_message {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum MessageType {
SessionOutput(std::boxed::Box<crate::model::SessionOutput>),
RecognitionResult(std::boxed::Box<crate::model::RecognitionResult>),
InterruptionSignal(std::boxed::Box<crate::model::InterruptionSignal>),
EndSession(std::boxed::Box<crate::model::EndSession>),
GoAway(std::boxed::Box<crate::model::GoAway>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SystemTool {
pub name: std::string::String,
pub description: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SystemTool {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
}
impl wkt::message::Message for SystemTool {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.SystemTool"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Tool {
pub name: std::string::String,
pub display_name: std::string::String,
pub execution_type: crate::model::ExecutionType,
pub timeout: std::option::Option<wkt::Duration>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub etag: std::string::String,
pub generated_summary: std::string::String,
pub tool_fake_config: std::option::Option<crate::model::ToolFakeConfig>,
pub tool_type: std::option::Option<crate::model::tool::ToolType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Tool {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_execution_type<T: std::convert::Into<crate::model::ExecutionType>>(
mut self,
v: T,
) -> Self {
self.execution_type = v.into();
self
}
pub fn set_timeout<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.timeout = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.timeout = v.map(|x| x.into());
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_generated_summary<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.generated_summary = v.into();
self
}
pub fn set_tool_fake_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ToolFakeConfig>,
{
self.tool_fake_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tool_fake_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ToolFakeConfig>,
{
self.tool_fake_config = v.map(|x| x.into());
self
}
pub fn set_tool_type<
T: std::convert::Into<std::option::Option<crate::model::tool::ToolType>>,
>(
mut self,
v: T,
) -> Self {
self.tool_type = v.into();
self
}
pub fn client_function(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ClientFunction>> {
#[allow(unreachable_patterns)]
self.tool_type.as_ref().and_then(|v| match v {
crate::model::tool::ToolType::ClientFunction(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_client_function<
T: std::convert::Into<std::boxed::Box<crate::model::ClientFunction>>,
>(
mut self,
v: T,
) -> Self {
self.tool_type =
std::option::Option::Some(crate::model::tool::ToolType::ClientFunction(v.into()));
self
}
pub fn open_api_tool(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::OpenApiTool>> {
#[allow(unreachable_patterns)]
self.tool_type.as_ref().and_then(|v| match v {
crate::model::tool::ToolType::OpenApiTool(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_open_api_tool<T: std::convert::Into<std::boxed::Box<crate::model::OpenApiTool>>>(
mut self,
v: T,
) -> Self {
self.tool_type =
std::option::Option::Some(crate::model::tool::ToolType::OpenApiTool(v.into()));
self
}
pub fn google_search_tool(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::GoogleSearchTool>> {
#[allow(unreachable_patterns)]
self.tool_type.as_ref().and_then(|v| match v {
crate::model::tool::ToolType::GoogleSearchTool(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_google_search_tool<
T: std::convert::Into<std::boxed::Box<crate::model::GoogleSearchTool>>,
>(
mut self,
v: T,
) -> Self {
self.tool_type =
std::option::Option::Some(crate::model::tool::ToolType::GoogleSearchTool(v.into()));
self
}
pub fn connector_tool(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ConnectorTool>> {
#[allow(unreachable_patterns)]
self.tool_type.as_ref().and_then(|v| match v {
crate::model::tool::ToolType::ConnectorTool(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_connector_tool<
T: std::convert::Into<std::boxed::Box<crate::model::ConnectorTool>>,
>(
mut self,
v: T,
) -> Self {
self.tool_type =
std::option::Option::Some(crate::model::tool::ToolType::ConnectorTool(v.into()));
self
}
pub fn data_store_tool(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DataStoreTool>> {
#[allow(unreachable_patterns)]
self.tool_type.as_ref().and_then(|v| match v {
crate::model::tool::ToolType::DataStoreTool(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_data_store_tool<
T: std::convert::Into<std::boxed::Box<crate::model::DataStoreTool>>,
>(
mut self,
v: T,
) -> Self {
self.tool_type =
std::option::Option::Some(crate::model::tool::ToolType::DataStoreTool(v.into()));
self
}
pub fn python_function(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::PythonFunction>> {
#[allow(unreachable_patterns)]
self.tool_type.as_ref().and_then(|v| match v {
crate::model::tool::ToolType::PythonFunction(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_python_function<
T: std::convert::Into<std::boxed::Box<crate::model::PythonFunction>>,
>(
mut self,
v: T,
) -> Self {
self.tool_type =
std::option::Option::Some(crate::model::tool::ToolType::PythonFunction(v.into()));
self
}
pub fn mcp_tool(&self) -> std::option::Option<&std::boxed::Box<crate::model::McpTool>> {
#[allow(unreachable_patterns)]
self.tool_type.as_ref().and_then(|v| match v {
crate::model::tool::ToolType::McpTool(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_mcp_tool<T: std::convert::Into<std::boxed::Box<crate::model::McpTool>>>(
mut self,
v: T,
) -> Self {
self.tool_type = std::option::Option::Some(crate::model::tool::ToolType::McpTool(v.into()));
self
}
pub fn file_search_tool(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::FileSearchTool>> {
#[allow(unreachable_patterns)]
self.tool_type.as_ref().and_then(|v| match v {
crate::model::tool::ToolType::FileSearchTool(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_file_search_tool<
T: std::convert::Into<std::boxed::Box<crate::model::FileSearchTool>>,
>(
mut self,
v: T,
) -> Self {
self.tool_type =
std::option::Option::Some(crate::model::tool::ToolType::FileSearchTool(v.into()));
self
}
pub fn system_tool(&self) -> std::option::Option<&std::boxed::Box<crate::model::SystemTool>> {
#[allow(unreachable_patterns)]
self.tool_type.as_ref().and_then(|v| match v {
crate::model::tool::ToolType::SystemTool(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_system_tool<T: std::convert::Into<std::boxed::Box<crate::model::SystemTool>>>(
mut self,
v: T,
) -> Self {
self.tool_type =
std::option::Option::Some(crate::model::tool::ToolType::SystemTool(v.into()));
self
}
pub fn agent_tool(&self) -> std::option::Option<&std::boxed::Box<crate::model::AgentTool>> {
#[allow(unreachable_patterns)]
self.tool_type.as_ref().and_then(|v| match v {
crate::model::tool::ToolType::AgentTool(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_agent_tool<T: std::convert::Into<std::boxed::Box<crate::model::AgentTool>>>(
mut self,
v: T,
) -> Self {
self.tool_type =
std::option::Option::Some(crate::model::tool::ToolType::AgentTool(v.into()));
self
}
pub fn widget_tool(&self) -> std::option::Option<&std::boxed::Box<crate::model::WidgetTool>> {
#[allow(unreachable_patterns)]
self.tool_type.as_ref().and_then(|v| match v {
crate::model::tool::ToolType::WidgetTool(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_widget_tool<T: std::convert::Into<std::boxed::Box<crate::model::WidgetTool>>>(
mut self,
v: T,
) -> Self {
self.tool_type =
std::option::Option::Some(crate::model::tool::ToolType::WidgetTool(v.into()));
self
}
pub fn remote_agent_tool(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::RemoteAgentTool>> {
#[allow(unreachable_patterns)]
self.tool_type.as_ref().and_then(|v| match v {
crate::model::tool::ToolType::RemoteAgentTool(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_remote_agent_tool<
T: std::convert::Into<std::boxed::Box<crate::model::RemoteAgentTool>>,
>(
mut self,
v: T,
) -> Self {
self.tool_type =
std::option::Option::Some(crate::model::tool::ToolType::RemoteAgentTool(v.into()));
self
}
}
impl wkt::message::Message for Tool {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Tool"
}
}
pub mod tool {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ToolType {
ClientFunction(std::boxed::Box<crate::model::ClientFunction>),
OpenApiTool(std::boxed::Box<crate::model::OpenApiTool>),
GoogleSearchTool(std::boxed::Box<crate::model::GoogleSearchTool>),
ConnectorTool(std::boxed::Box<crate::model::ConnectorTool>),
DataStoreTool(std::boxed::Box<crate::model::DataStoreTool>),
PythonFunction(std::boxed::Box<crate::model::PythonFunction>),
McpTool(std::boxed::Box<crate::model::McpTool>),
FileSearchTool(std::boxed::Box<crate::model::FileSearchTool>),
SystemTool(std::boxed::Box<crate::model::SystemTool>),
AgentTool(std::boxed::Box<crate::model::AgentTool>),
WidgetTool(std::boxed::Box<crate::model::WidgetTool>),
RemoteAgentTool(std::boxed::Box<crate::model::RemoteAgentTool>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecuteToolRequest {
pub parent: std::string::String,
pub args: std::option::Option<wkt::Struct>,
pub mock_config: std::option::Option<crate::model::MockConfig>,
pub tool_identifier: std::option::Option<crate::model::execute_tool_request::ToolIdentifier>,
pub tool_execution_context:
std::option::Option<crate::model::execute_tool_request::ToolExecutionContext>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecuteToolRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_args<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.args = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_args<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.args = v.map(|x| x.into());
self
}
pub fn set_mock_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MockConfig>,
{
self.mock_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_mock_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MockConfig>,
{
self.mock_config = v.map(|x| x.into());
self
}
pub fn set_tool_identifier<
T: std::convert::Into<std::option::Option<crate::model::execute_tool_request::ToolIdentifier>>,
>(
mut self,
v: T,
) -> Self {
self.tool_identifier = v.into();
self
}
pub fn tool(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.tool_identifier.as_ref().and_then(|v| match v {
crate::model::execute_tool_request::ToolIdentifier::Tool(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_tool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tool_identifier = std::option::Option::Some(
crate::model::execute_tool_request::ToolIdentifier::Tool(v.into()),
);
self
}
pub fn toolset_tool(&self) -> std::option::Option<&std::boxed::Box<crate::model::ToolsetTool>> {
#[allow(unreachable_patterns)]
self.tool_identifier.as_ref().and_then(|v| match v {
crate::model::execute_tool_request::ToolIdentifier::ToolsetTool(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_toolset_tool<T: std::convert::Into<std::boxed::Box<crate::model::ToolsetTool>>>(
mut self,
v: T,
) -> Self {
self.tool_identifier = std::option::Option::Some(
crate::model::execute_tool_request::ToolIdentifier::ToolsetTool(v.into()),
);
self
}
pub fn set_tool_execution_context<
T: std::convert::Into<
std::option::Option<crate::model::execute_tool_request::ToolExecutionContext>,
>,
>(
mut self,
v: T,
) -> Self {
self.tool_execution_context = v.into();
self
}
pub fn variables(&self) -> std::option::Option<&std::boxed::Box<wkt::Struct>> {
#[allow(unreachable_patterns)]
self.tool_execution_context.as_ref().and_then(|v| match v {
crate::model::execute_tool_request::ToolExecutionContext::Variables(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_variables<T: std::convert::Into<std::boxed::Box<wkt::Struct>>>(
mut self,
v: T,
) -> Self {
self.tool_execution_context = std::option::Option::Some(
crate::model::execute_tool_request::ToolExecutionContext::Variables(v.into()),
);
self
}
pub fn context(&self) -> std::option::Option<&std::boxed::Box<wkt::Struct>> {
#[allow(unreachable_patterns)]
self.tool_execution_context.as_ref().and_then(|v| match v {
crate::model::execute_tool_request::ToolExecutionContext::Context(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_context<T: std::convert::Into<std::boxed::Box<wkt::Struct>>>(
mut self,
v: T,
) -> Self {
self.tool_execution_context = std::option::Option::Some(
crate::model::execute_tool_request::ToolExecutionContext::Context(v.into()),
);
self
}
}
impl wkt::message::Message for ExecuteToolRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ExecuteToolRequest"
}
}
pub mod execute_tool_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ToolIdentifier {
Tool(std::string::String),
ToolsetTool(std::boxed::Box<crate::model::ToolsetTool>),
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ToolExecutionContext {
Variables(std::boxed::Box<wkt::Struct>),
Context(std::boxed::Box<wkt::Struct>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecuteToolResponse {
pub response: std::option::Option<wkt::Struct>,
pub variables: std::option::Option<wkt::Struct>,
pub citations: std::option::Option<crate::model::Citations>,
pub google_search_suggestions: std::option::Option<crate::model::GoogleSearchSuggestions>,
pub tool_identifier: std::option::Option<crate::model::execute_tool_response::ToolIdentifier>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecuteToolResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_response<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.response = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_response<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.response = v.map(|x| x.into());
self
}
pub fn set_variables<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.variables = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_variables<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.variables = v.map(|x| x.into());
self
}
pub fn set_citations<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Citations>,
{
self.citations = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_citations<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Citations>,
{
self.citations = v.map(|x| x.into());
self
}
pub fn set_google_search_suggestions<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GoogleSearchSuggestions>,
{
self.google_search_suggestions = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_google_search_suggestions<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GoogleSearchSuggestions>,
{
self.google_search_suggestions = v.map(|x| x.into());
self
}
pub fn set_tool_identifier<
T: std::convert::Into<
std::option::Option<crate::model::execute_tool_response::ToolIdentifier>,
>,
>(
mut self,
v: T,
) -> Self {
self.tool_identifier = v.into();
self
}
pub fn tool(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.tool_identifier.as_ref().and_then(|v| match v {
crate::model::execute_tool_response::ToolIdentifier::Tool(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_tool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tool_identifier = std::option::Option::Some(
crate::model::execute_tool_response::ToolIdentifier::Tool(v.into()),
);
self
}
pub fn toolset_tool(&self) -> std::option::Option<&std::boxed::Box<crate::model::ToolsetTool>> {
#[allow(unreachable_patterns)]
self.tool_identifier.as_ref().and_then(|v| match v {
crate::model::execute_tool_response::ToolIdentifier::ToolsetTool(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_toolset_tool<T: std::convert::Into<std::boxed::Box<crate::model::ToolsetTool>>>(
mut self,
v: T,
) -> Self {
self.tool_identifier = std::option::Option::Some(
crate::model::execute_tool_response::ToolIdentifier::ToolsetTool(v.into()),
);
self
}
}
impl wkt::message::Message for ExecuteToolResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ExecuteToolResponse"
}
}
pub mod execute_tool_response {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ToolIdentifier {
Tool(std::string::String),
ToolsetTool(std::boxed::Box<crate::model::ToolsetTool>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RetrieveToolSchemaRequest {
pub parent: std::string::String,
pub tool_identifier:
std::option::Option<crate::model::retrieve_tool_schema_request::ToolIdentifier>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RetrieveToolSchemaRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_tool_identifier<
T: std::convert::Into<
std::option::Option<crate::model::retrieve_tool_schema_request::ToolIdentifier>,
>,
>(
mut self,
v: T,
) -> Self {
self.tool_identifier = v.into();
self
}
pub fn tool(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.tool_identifier.as_ref().and_then(|v| match v {
crate::model::retrieve_tool_schema_request::ToolIdentifier::Tool(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_tool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tool_identifier = std::option::Option::Some(
crate::model::retrieve_tool_schema_request::ToolIdentifier::Tool(v.into()),
);
self
}
pub fn toolset_tool(&self) -> std::option::Option<&std::boxed::Box<crate::model::ToolsetTool>> {
#[allow(unreachable_patterns)]
self.tool_identifier.as_ref().and_then(|v| match v {
crate::model::retrieve_tool_schema_request::ToolIdentifier::ToolsetTool(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_toolset_tool<T: std::convert::Into<std::boxed::Box<crate::model::ToolsetTool>>>(
mut self,
v: T,
) -> Self {
self.tool_identifier = std::option::Option::Some(
crate::model::retrieve_tool_schema_request::ToolIdentifier::ToolsetTool(v.into()),
);
self
}
}
impl wkt::message::Message for RetrieveToolSchemaRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.RetrieveToolSchemaRequest"
}
}
pub mod retrieve_tool_schema_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ToolIdentifier {
Tool(std::string::String),
ToolsetTool(std::boxed::Box<crate::model::ToolsetTool>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RetrieveToolSchemaResponse {
pub input_schema: std::option::Option<crate::model::Schema>,
pub output_schema: std::option::Option<crate::model::Schema>,
pub tool_identifier:
std::option::Option<crate::model::retrieve_tool_schema_response::ToolIdentifier>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RetrieveToolSchemaResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_input_schema<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.input_schema = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_input_schema<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.input_schema = v.map(|x| x.into());
self
}
pub fn set_output_schema<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.output_schema = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_output_schema<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Schema>,
{
self.output_schema = v.map(|x| x.into());
self
}
pub fn set_tool_identifier<
T: std::convert::Into<
std::option::Option<crate::model::retrieve_tool_schema_response::ToolIdentifier>,
>,
>(
mut self,
v: T,
) -> Self {
self.tool_identifier = v.into();
self
}
pub fn tool(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.tool_identifier.as_ref().and_then(|v| match v {
crate::model::retrieve_tool_schema_response::ToolIdentifier::Tool(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_tool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tool_identifier = std::option::Option::Some(
crate::model::retrieve_tool_schema_response::ToolIdentifier::Tool(v.into()),
);
self
}
pub fn toolset_tool(&self) -> std::option::Option<&std::boxed::Box<crate::model::ToolsetTool>> {
#[allow(unreachable_patterns)]
self.tool_identifier.as_ref().and_then(|v| match v {
crate::model::retrieve_tool_schema_response::ToolIdentifier::ToolsetTool(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_toolset_tool<T: std::convert::Into<std::boxed::Box<crate::model::ToolsetTool>>>(
mut self,
v: T,
) -> Self {
self.tool_identifier = std::option::Option::Some(
crate::model::retrieve_tool_schema_response::ToolIdentifier::ToolsetTool(v.into()),
);
self
}
}
impl wkt::message::Message for RetrieveToolSchemaResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.RetrieveToolSchemaResponse"
}
}
pub mod retrieve_tool_schema_response {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ToolIdentifier {
Tool(std::string::String),
ToolsetTool(std::boxed::Box<crate::model::ToolsetTool>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RetrieveToolsRequest {
pub toolset: std::string::String,
pub tool_ids: std::vec::Vec<std::string::String>,
pub bypass_persistence_config: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RetrieveToolsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_toolset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.toolset = v.into();
self
}
pub fn set_tool_ids<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.tool_ids = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_bypass_persistence_config<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.bypass_persistence_config = v.into();
self
}
}
impl wkt::message::Message for RetrieveToolsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.RetrieveToolsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RetrieveToolsResponse {
pub tools: std::vec::Vec<crate::model::Tool>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RetrieveToolsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tools<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Tool>,
{
use std::iter::Iterator;
self.tools = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RetrieveToolsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.RetrieveToolsResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Toolset {
pub name: std::string::String,
pub display_name: std::string::String,
pub description: std::string::String,
pub timeout: std::option::Option<wkt::Duration>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub etag: std::string::String,
pub execution_type: crate::model::ExecutionType,
pub tool_fake_config: std::option::Option<crate::model::ToolFakeConfig>,
pub toolset_type: std::option::Option<crate::model::toolset::ToolsetType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Toolset {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_timeout<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.timeout = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.timeout = v.map(|x| x.into());
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_execution_type<T: std::convert::Into<crate::model::ExecutionType>>(
mut self,
v: T,
) -> Self {
self.execution_type = v.into();
self
}
pub fn set_tool_fake_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ToolFakeConfig>,
{
self.tool_fake_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tool_fake_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ToolFakeConfig>,
{
self.tool_fake_config = v.map(|x| x.into());
self
}
pub fn set_toolset_type<
T: std::convert::Into<std::option::Option<crate::model::toolset::ToolsetType>>,
>(
mut self,
v: T,
) -> Self {
self.toolset_type = v.into();
self
}
pub fn mcp_toolset(&self) -> std::option::Option<&std::boxed::Box<crate::model::McpToolset>> {
#[allow(unreachable_patterns)]
self.toolset_type.as_ref().and_then(|v| match v {
crate::model::toolset::ToolsetType::McpToolset(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_mcp_toolset<T: std::convert::Into<std::boxed::Box<crate::model::McpToolset>>>(
mut self,
v: T,
) -> Self {
self.toolset_type =
std::option::Option::Some(crate::model::toolset::ToolsetType::McpToolset(v.into()));
self
}
pub fn open_api_toolset(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::OpenApiToolset>> {
#[allow(unreachable_patterns)]
self.toolset_type.as_ref().and_then(|v| match v {
crate::model::toolset::ToolsetType::OpenApiToolset(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_open_api_toolset<
T: std::convert::Into<std::boxed::Box<crate::model::OpenApiToolset>>,
>(
mut self,
v: T,
) -> Self {
self.toolset_type =
std::option::Option::Some(crate::model::toolset::ToolsetType::OpenApiToolset(v.into()));
self
}
pub fn connector_toolset(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ConnectorToolset>> {
#[allow(unreachable_patterns)]
self.toolset_type.as_ref().and_then(|v| match v {
crate::model::toolset::ToolsetType::ConnectorToolset(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_connector_toolset<
T: std::convert::Into<std::boxed::Box<crate::model::ConnectorToolset>>,
>(
mut self,
v: T,
) -> Self {
self.toolset_type = std::option::Option::Some(
crate::model::toolset::ToolsetType::ConnectorToolset(v.into()),
);
self
}
}
impl wkt::message::Message for Toolset {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.Toolset"
}
}
pub mod toolset {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ToolsetType {
McpToolset(std::boxed::Box<crate::model::McpToolset>),
OpenApiToolset(std::boxed::Box<crate::model::OpenApiToolset>),
ConnectorToolset(std::boxed::Box<crate::model::ConnectorToolset>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ToolsetTool {
pub toolset: std::string::String,
pub tool_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ToolsetTool {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_toolset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.toolset = v.into();
self
}
pub fn set_tool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tool_id = v.into();
self
}
}
impl wkt::message::Message for ToolsetTool {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.ToolsetTool"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GenerateChatTokenRequest {
pub name: std::string::String,
pub deployment: std::string::String,
pub recaptcha_token: std::string::String,
pub live_handoff_enabled: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GenerateChatTokenRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.deployment = v.into();
self
}
pub fn set_recaptcha_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.recaptcha_token = v.into();
self
}
pub fn set_live_handoff_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.live_handoff_enabled = v.into();
self
}
}
impl wkt::message::Message for GenerateChatTokenRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.GenerateChatTokenRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GenerateChatTokenResponse {
pub chat_token: std::string::String,
pub expire_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GenerateChatTokenResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_chat_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.chat_token = v.into();
self
}
pub fn set_expire_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expire_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expire_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GenerateChatTokenResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.GenerateChatTokenResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WidgetTool {
pub name: std::string::String,
pub description: std::string::String,
pub widget_type: crate::model::widget_tool::WidgetType,
pub ui_config: std::option::Option<wkt::Struct>,
pub data_mapping: std::option::Option<crate::model::widget_tool::DataMapping>,
pub text_response_config: std::option::Option<crate::model::widget_tool::TextResponseConfig>,
pub input: std::option::Option<crate::model::widget_tool::Input>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WidgetTool {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_widget_type<T: std::convert::Into<crate::model::widget_tool::WidgetType>>(
mut self,
v: T,
) -> Self {
self.widget_type = v.into();
self
}
pub fn set_ui_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.ui_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ui_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.ui_config = v.map(|x| x.into());
self
}
pub fn set_data_mapping<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::widget_tool::DataMapping>,
{
self.data_mapping = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_data_mapping<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::widget_tool::DataMapping>,
{
self.data_mapping = v.map(|x| x.into());
self
}
pub fn set_text_response_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::widget_tool::TextResponseConfig>,
{
self.text_response_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_text_response_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::widget_tool::TextResponseConfig>,
{
self.text_response_config = v.map(|x| x.into());
self
}
pub fn set_input<
T: std::convert::Into<std::option::Option<crate::model::widget_tool::Input>>,
>(
mut self,
v: T,
) -> Self {
self.input = v.into();
self
}
pub fn parameters(&self) -> std::option::Option<&std::boxed::Box<crate::model::Schema>> {
#[allow(unreachable_patterns)]
self.input.as_ref().and_then(|v| match v {
crate::model::widget_tool::Input::Parameters(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_parameters<T: std::convert::Into<std::boxed::Box<crate::model::Schema>>>(
mut self,
v: T,
) -> Self {
self.input =
std::option::Option::Some(crate::model::widget_tool::Input::Parameters(v.into()));
self
}
}
impl wkt::message::Message for WidgetTool {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.WidgetTool"
}
}
pub mod widget_tool {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TextResponseConfig {
pub r#type: crate::model::widget_tool::text_response_config::Type,
pub static_text: std::string::String,
pub text_response_instruction: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TextResponseConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<
T: std::convert::Into<crate::model::widget_tool::text_response_config::Type>,
>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_static_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.static_text = v.into();
self
}
pub fn set_text_response_instruction<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.text_response_instruction = v.into();
self
}
}
impl wkt::message::Message for TextResponseConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.WidgetTool.TextResponseConfig"
}
}
pub mod text_response_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
None,
LlmGenerated,
Static,
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::None => std::option::Option::Some(1),
Self::LlmGenerated => std::option::Option::Some(2),
Self::Static => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::None => std::option::Option::Some("NONE"),
Self::LlmGenerated => std::option::Option::Some("LLM_GENERATED"),
Self::Static => std::option::Option::Some("STATIC"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::None,
2 => Self::LlmGenerated,
3 => Self::Static,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"NONE" => Self::None,
"LLM_GENERATED" => Self::LlmGenerated,
"STATIC" => Self::Static,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::None => serializer.serialize_i32(1),
Self::LlmGenerated => serializer.serialize_i32(2),
Self::Static => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.ces.v1.WidgetTool.TextResponseConfig.Type",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataMapping {
pub source_tool_name: std::string::String,
pub field_mappings: std::collections::HashMap<std::string::String, std::string::String>,
pub python_function: std::option::Option<crate::model::PythonFunction>,
pub mode: crate::model::widget_tool::data_mapping::Mode,
#[deprecated]
pub python_script: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataMapping {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source_tool_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.source_tool_name = v.into();
self
}
pub fn set_field_mappings<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.field_mappings = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_python_function<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PythonFunction>,
{
self.python_function = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_python_function<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PythonFunction>,
{
self.python_function = v.map(|x| x.into());
self
}
pub fn set_mode<T: std::convert::Into<crate::model::widget_tool::data_mapping::Mode>>(
mut self,
v: T,
) -> Self {
self.mode = v.into();
self
}
#[deprecated]
pub fn set_python_script<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.python_script = v.into();
self
}
}
impl wkt::message::Message for DataMapping {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.ces.v1.WidgetTool.DataMapping"
}
}
pub mod data_mapping {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Mode {
Unspecified,
FieldMapping,
PythonScript,
UnknownValue(mode::UnknownValue),
}
#[doc(hidden)]
pub mod mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Mode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::FieldMapping => std::option::Option::Some(1),
Self::PythonScript => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
Self::FieldMapping => std::option::Option::Some("FIELD_MAPPING"),
Self::PythonScript => std::option::Option::Some("PYTHON_SCRIPT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Mode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Mode {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Mode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::FieldMapping,
2 => Self::PythonScript,
_ => Self::UnknownValue(mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Mode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MODE_UNSPECIFIED" => Self::Unspecified,
"FIELD_MAPPING" => Self::FieldMapping,
"PYTHON_SCRIPT" => Self::PythonScript,
_ => Self::UnknownValue(mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Mode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::FieldMapping => serializer.serialize_i32(1),
Self::PythonScript => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Mode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
".google.cloud.ces.v1.WidgetTool.DataMapping.Mode",
))
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum WidgetType {
Unspecified,
Custom,
ProductCarousel,
ProductDetails,
QuickActions,
ProductComparison,
AdvancedProductDetails,
ShortForm,
OverallSatisfaction,
OrderSummary,
AppointmentDetails,
AppointmentScheduler,
ContactForm,
UnknownValue(widget_type::UnknownValue),
}
#[doc(hidden)]
pub mod widget_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl WidgetType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Custom => std::option::Option::Some(1),
Self::ProductCarousel => std::option::Option::Some(2),
Self::ProductDetails => std::option::Option::Some(3),
Self::QuickActions => std::option::Option::Some(4),
Self::ProductComparison => std::option::Option::Some(5),
Self::AdvancedProductDetails => std::option::Option::Some(6),
Self::ShortForm => std::option::Option::Some(7),
Self::OverallSatisfaction => std::option::Option::Some(8),
Self::OrderSummary => std::option::Option::Some(9),
Self::AppointmentDetails => std::option::Option::Some(10),
Self::AppointmentScheduler => std::option::Option::Some(11),
Self::ContactForm => std::option::Option::Some(12),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("WIDGET_TYPE_UNSPECIFIED"),
Self::Custom => std::option::Option::Some("CUSTOM"),
Self::ProductCarousel => std::option::Option::Some("PRODUCT_CAROUSEL"),
Self::ProductDetails => std::option::Option::Some("PRODUCT_DETAILS"),
Self::QuickActions => std::option::Option::Some("QUICK_ACTIONS"),
Self::ProductComparison => std::option::Option::Some("PRODUCT_COMPARISON"),
Self::AdvancedProductDetails => {
std::option::Option::Some("ADVANCED_PRODUCT_DETAILS")
}
Self::ShortForm => std::option::Option::Some("SHORT_FORM"),
Self::OverallSatisfaction => std::option::Option::Some("OVERALL_SATISFACTION"),
Self::OrderSummary => std::option::Option::Some("ORDER_SUMMARY"),
Self::AppointmentDetails => std::option::Option::Some("APPOINTMENT_DETAILS"),
Self::AppointmentScheduler => std::option::Option::Some("APPOINTMENT_SCHEDULER"),
Self::ContactForm => std::option::Option::Some("CONTACT_FORM"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for WidgetType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for WidgetType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for WidgetType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Custom,
2 => Self::ProductCarousel,
3 => Self::ProductDetails,
4 => Self::QuickActions,
5 => Self::ProductComparison,
6 => Self::AdvancedProductDetails,
7 => Self::ShortForm,
8 => Self::OverallSatisfaction,
9 => Self::OrderSummary,
10 => Self::AppointmentDetails,
11 => Self::AppointmentScheduler,
12 => Self::ContactForm,
_ => Self::UnknownValue(widget_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for WidgetType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"WIDGET_TYPE_UNSPECIFIED" => Self::Unspecified,
"CUSTOM" => Self::Custom,
"PRODUCT_CAROUSEL" => Self::ProductCarousel,
"PRODUCT_DETAILS" => Self::ProductDetails,
"QUICK_ACTIONS" => Self::QuickActions,
"PRODUCT_COMPARISON" => Self::ProductComparison,
"ADVANCED_PRODUCT_DETAILS" => Self::AdvancedProductDetails,
"SHORT_FORM" => Self::ShortForm,
"OVERALL_SATISFACTION" => Self::OverallSatisfaction,
"ORDER_SUMMARY" => Self::OrderSummary,
"APPOINTMENT_DETAILS" => Self::AppointmentDetails,
"APPOINTMENT_SCHEDULER" => Self::AppointmentScheduler,
"CONTACT_FORM" => Self::ContactForm,
_ => Self::UnknownValue(widget_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for WidgetType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Custom => serializer.serialize_i32(1),
Self::ProductCarousel => serializer.serialize_i32(2),
Self::ProductDetails => serializer.serialize_i32(3),
Self::QuickActions => serializer.serialize_i32(4),
Self::ProductComparison => serializer.serialize_i32(5),
Self::AdvancedProductDetails => serializer.serialize_i32(6),
Self::ShortForm => serializer.serialize_i32(7),
Self::OverallSatisfaction => serializer.serialize_i32(8),
Self::OrderSummary => serializer.serialize_i32(9),
Self::AppointmentDetails => serializer.serialize_i32(10),
Self::AppointmentScheduler => serializer.serialize_i32(11),
Self::ContactForm => serializer.serialize_i32(12),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for WidgetType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<WidgetType>::new(
".google.cloud.ces.v1.WidgetTool.WidgetType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Input {
Parameters(std::boxed::Box<crate::model::Schema>),
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ExecutionType {
Unspecified,
Synchronous,
Asynchronous,
UnknownValue(execution_type::UnknownValue),
}
#[doc(hidden)]
pub mod execution_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ExecutionType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Synchronous => std::option::Option::Some(1),
Self::Asynchronous => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("EXECUTION_TYPE_UNSPECIFIED"),
Self::Synchronous => std::option::Option::Some("SYNCHRONOUS"),
Self::Asynchronous => std::option::Option::Some("ASYNCHRONOUS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ExecutionType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ExecutionType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ExecutionType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Synchronous,
2 => Self::Asynchronous,
_ => Self::UnknownValue(execution_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ExecutionType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EXECUTION_TYPE_UNSPECIFIED" => Self::Unspecified,
"SYNCHRONOUS" => Self::Synchronous,
"ASYNCHRONOUS" => Self::Asynchronous,
_ => Self::UnknownValue(execution_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ExecutionType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Synchronous => serializer.serialize_i32(1),
Self::Asynchronous => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ExecutionType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExecutionType>::new(
".google.cloud.ces.v1.ExecutionType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AudioEncoding {
Unspecified,
Linear16,
Mulaw,
Alaw,
UnknownValue(audio_encoding::UnknownValue),
}
#[doc(hidden)]
pub mod audio_encoding {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl AudioEncoding {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Linear16 => std::option::Option::Some(1),
Self::Mulaw => std::option::Option::Some(2),
Self::Alaw => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("AUDIO_ENCODING_UNSPECIFIED"),
Self::Linear16 => std::option::Option::Some("LINEAR16"),
Self::Mulaw => std::option::Option::Some("MULAW"),
Self::Alaw => std::option::Option::Some("ALAW"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for AudioEncoding {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for AudioEncoding {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for AudioEncoding {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Linear16,
2 => Self::Mulaw,
3 => Self::Alaw,
_ => Self::UnknownValue(audio_encoding::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for AudioEncoding {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"AUDIO_ENCODING_UNSPECIFIED" => Self::Unspecified,
"LINEAR16" => Self::Linear16,
"MULAW" => Self::Mulaw,
"ALAW" => Self::Alaw,
_ => Self::UnknownValue(audio_encoding::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for AudioEncoding {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Linear16 => serializer.serialize_i32(1),
Self::Mulaw => serializer.serialize_i32(2),
Self::Alaw => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for AudioEncoding {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<AudioEncoding>::new(
".google.cloud.ces.v1.AudioEncoding",
))
}
}