/*
* Zernio API
*
* API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
*
* The version of the OpenAPI document: 1.0.4
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BusinessAgentConnectorInput {
/// Unique per number.
#[serde(rename = "name")]
pub name: String,
/// Tell the agent what the service provides.
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
/// Public HTTPS URL reachable from Meta.
#[serde(rename = "base_url")]
pub base_url: String,
#[serde(rename = "connector_protocol", skip_serializing_if = "Option::is_none")]
pub connector_protocol: Option<String>,
#[serde(rename = "auth_type")]
pub auth_type: AuthType,
#[serde(rename = "auth_config", skip_serializing_if = "Option::is_none")]
pub auth_config: Option<Box<models::BusinessAgentConnectorInputAuthConfig>>,
#[serde(
rename = "user_auth_injection_config",
skip_serializing_if = "Option::is_none"
)]
pub user_auth_injection_config:
Option<Box<models::BusinessAgentConnectorInputUserAuthInjectionConfig>>,
#[serde(
rename = "requires_certificate",
skip_serializing_if = "Option::is_none"
)]
pub requires_certificate: Option<bool>,
}
impl BusinessAgentConnectorInput {
pub fn new(name: String, base_url: String, auth_type: AuthType) -> BusinessAgentConnectorInput {
BusinessAgentConnectorInput {
name,
description: None,
base_url,
connector_protocol: None,
auth_type,
auth_config: None,
user_auth_injection_config: None,
requires_certificate: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AuthType {
#[serde(rename = "OAUTH2_CLIENT_CREDENTIALS")]
Oauth2ClientCredentials,
#[serde(rename = "API_KEY")]
ApiKey,
#[serde(rename = "NONE")]
None,
}
impl Default for AuthType {
fn default() -> AuthType {
Self::Oauth2ClientCredentials
}
}