// DO NOT EDIT - generated by codegen/generate_rust.py from codegen/models.json.
// Regenerate with:
// python3 codegen/normalize_spec.py spec/openapi.json spec/overlay.json > codegen/models.json
// python3 codegen/generate_rust.py codegen/models.json > src/models/generated.rs
use std::collections::BTreeMap;
use std::fmt;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use serde_json::{Map, Value};
fn open_enum_string<'de, D: Deserializer<'de>>(deserializer: D) -> Result<String, D::Error> {
// Accept any JSON scalar so an unexpected server value never fails decoding.
Ok(match Value::deserialize(deserializer)? {
Value::String(s) => s,
Value::Null => String::new(),
other => other.to_string(),
})
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsBreakdownResponse {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub metric: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub dimension: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub from: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub to: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub rows: Option<Vec<AnalyticsBreakdownResponseRowsItem>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub next_cursor: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsBreakdownResponseRowsItem {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub value: Option<f64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub numerator: Option<f64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub denominator: Option<f64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub calls: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub errors: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_active_day: Option<String>,
#[doc = " When the account was last seen in the range (UTC), for `dimension=integrated_account`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_active_at: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tenant_id: Option<String>,
#[doc = " The account's current status (not its status during the range)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[doc = " The account's `context.label` (who or what it belongs to), for `dimension=integrated_account`. `null` when the account has no text label."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsDashboardKpi {
#[doc = " Null when there is nothing to measure, e.g. a rate with no requests behind it."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub value: Option<f64>,
#[doc = " The same figure for the span of equal length just before the range (ending at the same time of day); null when that span is not inside the 90-day window, and for numbers that describe the accounts as they are now."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub previous: Option<f64>,
#[doc = " One value per day of the range (null for a rate or latency with no requests that day); empty for numbers that describe the accounts as they are now."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub series: Option<Vec<f64>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsDashboardResponse {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[doc = " The named range shown, or `custom` for `from` / `to`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub range: Option<AnalyticsDashboardResponseRange>,
#[doc = " The days analytics can show (the last 90 days, up to today)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub window: Option<AnalyticsDashboardResponseWindow>,
#[doc = " How long the parts of this response are cached."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cache_seconds: Option<i64>,
#[doc = " The page filters applied, as sent."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub filters: Option<BTreeMap<String, String>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub from: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub to: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub previous: Option<AnalyticsDashboardResponsePrevious>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub buckets: Option<Vec<String>>,
#[doc = " When the numbers were read. Responses are cached for 6 hours, so a range that includes today shows today as of this time."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub generated_at: Option<String>,
#[doc = " Each headline number for the range, the span of the same length before it, and a daily series. `accounts`, `active_accounts` and `active_integrations` describe the accounts as they are now, so they have no previous value or series."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub kpis: Option<AnalyticsDashboardResponseKpis>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub by_category: Option<Vec<AnalyticsDashboardResponseByCategoryItem>>,
#[doc = " The environment's integrations and integrated accounts as they are now (sandbox accounts excluded)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub inventory: Option<AnalyticsDashboardResponseInventory>,
#[doc = " Integrated account lifecycle events in the range, from the logs (for example `created`, `updated`, `deleted`)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub account_events: Option<Vec<AnalyticsDashboardResponseAccountEventsItem>>,
#[doc = " Every integration with API calls in the range or integrated accounts now, by API calls."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integrations: Option<Vec<AnalyticsDashboardResponseIntegrationsItem>>,
#[doc = " API calls per day (as billing counts them), aligned with `buckets`. `null` when it could not be loaded."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub api_calls: Option<AnalyticsDashboardResponseApiCalls>,
#[doc = " p95 latency per day in ms, total and waiting on the provider; `null` on a day without requests."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub latency_p95: Option<AnalyticsDashboardResponseLatencyP95>,
#[doc = " API calls per hour (UTC) over the last 7 days of the range; an hour later today is `null`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub hourly_api_calls: Option<AnalyticsDashboardResponseHourlyApiCalls>,
#[doc = " API requests by HTTP status class (`2`, `4`, `5`, ...), largest first."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_codes: Option<Vec<AnalyticsDashboardResponseStatusCodesItem>>,
#[doc = " The integrations with the most requests that returned HTTP 400 or above. An empty `key` is calls with no integration (Admin API calls, and requests that failed before an integration was known)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub errors_by_integration: Option<Vec<AnalyticsDashboardResponseErrorsByIntegrationItem>>,
#[doc = " One page of the integrated accounts with the most API calls in the range. Only accounts that still exist are listed."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub accounts: Option<AnalyticsDashboardResponseAccounts>,
#[doc = " Parts that could not be loaded right now and are `null` (`api_calls`, `latency`, `hourly_api_calls`, `status_codes`, `errors_by_integration`, `accounts`)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub unavailable: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsDashboardResponseAccountEventsItem {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub event: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub count: Option<i64>,
}
#[doc = " One page of the integrated accounts with the most API calls in the range. Only accounts that still exist are listed."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsDashboardResponseAccounts {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub rows: Option<Vec<AnalyticsDashboardResponseAccountsRowsItem>>,
#[doc = " Pass as `accounts_cursor` for the next page."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub next_cursor: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub search: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsDashboardResponseAccountsRowsItem {
#[doc = " The integrated account id."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[doc = " API calls."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub value: Option<f64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub calls: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub errors: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_active_day: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_active_at: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tenant_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[doc = " The account's `context.label`, when it is text."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
}
#[doc = " API calls per day (as billing counts them), aligned with `buckets`. `null` when it could not be loaded."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsDashboardResponseApiCalls {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub buckets: Option<Vec<String>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub total: Option<Vec<AnalyticsDashboardResponseApiCallsTotalItem>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub by_category: Option<Vec<AnalyticsDashboardResponseApiCallsByCategoryItem>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub by_integration: Option<Vec<AnalyticsDashboardResponseApiCallsByIntegrationItem>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsDashboardResponseApiCallsByCategoryItem {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub values: Option<Vec<f64>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub total: Option<f64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsDashboardResponseApiCallsByIntegrationItem {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub values: Option<Vec<f64>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub total: Option<f64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsDashboardResponseApiCallsTotalItem {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub values: Option<Vec<f64>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub total: Option<f64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsDashboardResponseByCategoryItem {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub category: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub calls: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsDashboardResponseErrorsByIntegrationItem {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub value: Option<f64>,
}
#[doc = " API calls per hour (UTC) over the last 7 days of the range; an hour later today is `null`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsDashboardResponseHourlyApiCalls {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub from: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub to: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub buckets: Option<Vec<String>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub values: Option<Vec<f64>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsDashboardResponseIntegrationsItem {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration: Option<String>,
#[doc = " API calls as billing counts them (the `billable_api_calls` filter)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub calls: Option<i64>,
#[doc = " API requests, the denominator of the error rate."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub requests: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub errors: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub accounts: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub active_accounts: Option<i64>,
#[doc = " Accounts with status `needs_reauth`, `validation_error` or `post_install_error` now."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub attention_accounts: Option<i64>,
}
#[doc = " The environment's integrations and integrated accounts as they are now (sandbox accounts excluded)."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsDashboardResponseInventory {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub as_of: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub accounts: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub by_status: Option<BTreeMap<String, i64>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub active_connections: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub superquery_accounts: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub installed_connectors: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub active_connectors: Option<i64>,
}
#[doc = " Each headline number for the range, the span of the same length before it, and a daily series. `accounts`, `active_accounts` and `active_integrations` describe the accounts as they are now, so they have no previous value or series."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsDashboardResponseKpis {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub api_calls: Option<AnalyticsDashboardKpi>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub billable_api_calls: Option<AnalyticsDashboardKpi>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub errors: Option<AnalyticsDashboardKpi>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error_rate: Option<AnalyticsDashboardKpi>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub rate_limited: Option<AnalyticsDashboardKpi>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub latency_p95: Option<AnalyticsDashboardKpi>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub provider_latency_p95: Option<AnalyticsDashboardKpi>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub records_synced: Option<AnalyticsDashboardKpi>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sync_failures: Option<AnalyticsDashboardKpi>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub webhook_events: Option<AnalyticsDashboardKpi>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub webhook_failure_rate: Option<AnalyticsDashboardKpi>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mcp_calls: Option<AnalyticsDashboardKpi>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub new_accounts: Option<AnalyticsDashboardKpi>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub accounts: Option<AnalyticsDashboardKpi>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub active_accounts: Option<AnalyticsDashboardKpi>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub active_integrations: Option<AnalyticsDashboardKpi>,
}
#[doc = " p95 latency per day in ms, total and waiting on the provider; `null` on a day without requests."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsDashboardResponseLatencyP95 {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub buckets: Option<Vec<String>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub total: Option<Vec<f64>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub provider: Option<Vec<f64>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsDashboardResponsePrevious {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub from: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub to: Option<String>,
}
#[doc = " The named range shown, or `custom` for `from` / `to`."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AnalyticsDashboardResponseRange {
#[doc = " `mtd`"]
Mtd,
#[doc = " `last_month`"]
LastMonth,
#[doc = " `7d`"]
V7d,
#[doc = " `30d`"]
V30d,
#[doc = " `90d`"]
V90d,
#[doc = " `custom`"]
Custom,
/// A value not known to this version of the SDK.
Other(String),
}
impl AnalyticsDashboardResponseRange {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Mtd => "mtd",
Self::LastMonth => "last_month",
Self::V7d => "7d",
Self::V30d => "30d",
Self::V90d => "90d",
Self::Custom => "custom",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for AnalyticsDashboardResponseRange {
fn from(s: &str) -> Self {
match s {
"mtd" => Self::Mtd,
"last_month" => Self::LastMonth,
"7d" => Self::V7d,
"30d" => Self::V30d,
"90d" => Self::V90d,
"custom" => Self::Custom,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for AnalyticsDashboardResponseRange {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for AnalyticsDashboardResponseRange {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for AnalyticsDashboardResponseRange {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for AnalyticsDashboardResponseRange {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for AnalyticsDashboardResponseRange {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsDashboardResponseStatusCodesItem {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub value: Option<f64>,
}
#[doc = " The days analytics can show (the last 90 days, up to today)."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsDashboardResponseWindow {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub from: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub to: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsMetricsResponse {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub metrics: Option<Vec<AnalyticsMetricsResponseMetricsItem>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub dimensions: Option<Vec<AnalyticsMetricsResponseDimensionsItem>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub categories: Option<Vec<AnalyticsMetricsResponseCategoriesItem>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsMetricsResponseCategoriesItem {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsMetricsResponseDimensionsItem {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsMetricsResponseMetricsItem {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub unit: Option<AnalyticsMetricsResponseMetricsItemUnit>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub kind: Option<AnalyticsMetricsResponseMetricsItemKind>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub granularities: Option<Vec<AnalyticsMetricsResponseMetricsItemGranularitiesItem>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub dimensions: Option<Vec<String>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub breakdowns: Option<Vec<String>>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AnalyticsMetricsResponseMetricsItemGranularitiesItem {
#[doc = " `day`"]
Day,
#[doc = " `hour`"]
Hour,
/// A value not known to this version of the SDK.
Other(String),
}
impl AnalyticsMetricsResponseMetricsItemGranularitiesItem {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Day => "day",
Self::Hour => "hour",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for AnalyticsMetricsResponseMetricsItemGranularitiesItem {
fn from(s: &str) -> Self {
match s {
"day" => Self::Day,
"hour" => Self::Hour,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for AnalyticsMetricsResponseMetricsItemGranularitiesItem {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for AnalyticsMetricsResponseMetricsItemGranularitiesItem {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for AnalyticsMetricsResponseMetricsItemGranularitiesItem {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for AnalyticsMetricsResponseMetricsItemGranularitiesItem {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for AnalyticsMetricsResponseMetricsItemGranularitiesItem {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AnalyticsMetricsResponseMetricsItemKind {
#[doc = " `sum`"]
Sum,
#[doc = " `ratio`"]
Ratio,
#[doc = " `latency`"]
Latency,
/// A value not known to this version of the SDK.
Other(String),
}
impl AnalyticsMetricsResponseMetricsItemKind {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Sum => "sum",
Self::Ratio => "ratio",
Self::Latency => "latency",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for AnalyticsMetricsResponseMetricsItemKind {
fn from(s: &str) -> Self {
match s {
"sum" => Self::Sum,
"ratio" => Self::Ratio,
"latency" => Self::Latency,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for AnalyticsMetricsResponseMetricsItemKind {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for AnalyticsMetricsResponseMetricsItemKind {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for AnalyticsMetricsResponseMetricsItemKind {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for AnalyticsMetricsResponseMetricsItemKind {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for AnalyticsMetricsResponseMetricsItemKind {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AnalyticsMetricsResponseMetricsItemUnit {
#[doc = " `count`"]
Count,
#[doc = " `ratio`"]
Ratio,
#[doc = " `ms`"]
Ms,
/// A value not known to this version of the SDK.
Other(String),
}
impl AnalyticsMetricsResponseMetricsItemUnit {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Count => "count",
Self::Ratio => "ratio",
Self::Ms => "ms",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for AnalyticsMetricsResponseMetricsItemUnit {
fn from(s: &str) -> Self {
match s {
"count" => Self::Count,
"ratio" => Self::Ratio,
"ms" => Self::Ms,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for AnalyticsMetricsResponseMetricsItemUnit {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for AnalyticsMetricsResponseMetricsItemUnit {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for AnalyticsMetricsResponseMetricsItemUnit {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for AnalyticsMetricsResponseMetricsItemUnit {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for AnalyticsMetricsResponseMetricsItemUnit {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsStatusResponse {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[doc = " The first and last UTC day that can be requested. `to` is today."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub window: Option<AnalyticsStatusResponseWindow>,
#[doc = " How long analytics responses are cached."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cache_seconds: Option<i64>,
}
#[doc = " The first and last UTC day that can be requested. `to` is today."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsStatusResponseWindow {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub from: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub to: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsTimeseriesResponse {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub metric: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub unit: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub kind: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub granularity: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub from: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub to: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub buckets: Option<Vec<String>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub series: Option<Vec<AnalyticsTimeseriesResponseSeriesItem>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AnalyticsTimeseriesResponseSeriesItem {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub values: Option<Vec<f64>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub total: Option<f64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct ApiTokenResponse {
#[doc = " The ID of the API token."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " A descriptive name for the token."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " The ID of the user who created this token."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_by: Option<String>,
#[doc = " The ID of the environment this token is scoped to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[doc = " The date and time when the token was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the token was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
#[doc = " Last time the token was used (UTC). Null until first use."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_used_at: Option<String>,
}
#[doc = " The refusal returned when a link token is requested for an integration that nothing can connect, because its app-level credentials were never configured in this environment."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AppCredentialsNotConfiguredError {
#[serde(rename = "statusCode")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_code: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub truto_error_code: Option<AppCredentialsNotConfiguredErrorTrutoErrorCode>,
#[doc = " The integration's name."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_integration_id: Option<String>,
#[doc = " The methods that are missing their app credentials."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authentication_methods: Option<Vec<AppCredentialsNotConfiguredErrorAuthenticationMethodsItem>>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AppCredentialsNotConfiguredErrorAuthenticationMethodsItem {
#[doc = " `oauth2`"]
Oauth2,
#[doc = " `aws_sts`"]
AwsSts,
/// A value not known to this version of the SDK.
Other(String),
}
impl AppCredentialsNotConfiguredErrorAuthenticationMethodsItem {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Oauth2 => "oauth2",
Self::AwsSts => "aws_sts",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for AppCredentialsNotConfiguredErrorAuthenticationMethodsItem {
fn from(s: &str) -> Self {
match s {
"oauth2" => Self::Oauth2,
"aws_sts" => Self::AwsSts,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for AppCredentialsNotConfiguredErrorAuthenticationMethodsItem {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for AppCredentialsNotConfiguredErrorAuthenticationMethodsItem {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for AppCredentialsNotConfiguredErrorAuthenticationMethodsItem {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for AppCredentialsNotConfiguredErrorAuthenticationMethodsItem {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for AppCredentialsNotConfiguredErrorAuthenticationMethodsItem {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AppCredentialsNotConfiguredErrorTrutoErrorCode {
#[doc = " `app_credentials_not_configured`"]
AppCredentialsNotConfigured,
/// A value not known to this version of the SDK.
Other(String),
}
impl AppCredentialsNotConfiguredErrorTrutoErrorCode {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::AppCredentialsNotConfigured => "app_credentials_not_configured",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for AppCredentialsNotConfiguredErrorTrutoErrorCode {
fn from(s: &str) -> Self {
match s {
"app_credentials_not_configured" => Self::AppCredentialsNotConfigured,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for AppCredentialsNotConfiguredErrorTrutoErrorCode {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for AppCredentialsNotConfiguredErrorTrutoErrorCode {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for AppCredentialsNotConfiguredErrorTrutoErrorCode {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for AppCredentialsNotConfiguredErrorTrutoErrorCode {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for AppCredentialsNotConfiguredErrorTrutoErrorCode {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " The combined response returned by `POST /batch-request`. Successful resource records are grouped under `result`, keyed by the `name` of each resource in the request. Errors are surfaced under `errors`, keyed the same way."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct BatchRequestResponse {
#[doc = " Map of resource names to the records fetched for that resource. The key is the resource's `name` from the request body."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub result: Option<BTreeMap<String, Vec<Value>>>,
#[doc = " Map of resource names to errors encountered while processing that resource. Present only for resources that failed."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub errors: Option<BTreeMap<String, Vec<BatchRequestResponseErrorsValueItem>>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct BatchRequestResponseErrorsValueItem {
#[doc = " Serialized error object describing what went wrong."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error: Option<Map<String, Value>>,
#[doc = " Milliseconds to wait before retrying. Set when the upstream API returned a rate-limit response."]
#[serde(rename = "retryAfter")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub retry_after: Option<f64>,
}
#[doc = " The request body for creating a batch request, containing an integrated account ID and an array of resources."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct BatchRequestSchema {
#[doc = " The ID of the integrated account in whose context these resource calls are made."]
pub integrated_account_id: String,
#[doc = " Optional arguments available for placeholder replacement in resource definitions."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub args: Option<Map<String, Value>>,
#[doc = " A list of resource definitions that can be either a request or a transform."]
pub resources: Vec<SyncJobResourceSchema>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct BillingAccountResponse {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub team_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub stripe_customer_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub has_stripe_customer: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub has_payment_method: Option<bool>,
#[doc = " Informational; nothing is enforced on it today."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub billing_status: Option<BillingAccountResponseBillingStatus>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub billing_email: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub currency: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub payment_method_summary: Option<BillingAccountResponsePaymentMethodSummary>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub billing_address: Option<BillingAccountResponseBillingAddress>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tax_ids: Option<Vec<BillingAccountResponseTaxIdsItem>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_synced_at: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_payment_failed_at: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct BillingAccountResponseBillingAddress {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub line1: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub line2: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub city: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub postal_code: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub country: Option<String>,
}
#[doc = " Informational; nothing is enforced on it today."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum BillingAccountResponseBillingStatus {
#[doc = " `active`"]
Active,
#[doc = " `past_due`"]
PastDue,
#[doc = " `suspended`"]
Suspended,
#[doc = " `exempt`"]
Exempt,
/// A value not known to this version of the SDK.
Other(String),
}
impl BillingAccountResponseBillingStatus {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Active => "active",
Self::PastDue => "past_due",
Self::Suspended => "suspended",
Self::Exempt => "exempt",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for BillingAccountResponseBillingStatus {
fn from(s: &str) -> Self {
match s {
"active" => Self::Active,
"past_due" => Self::PastDue,
"suspended" => Self::Suspended,
"exempt" => Self::Exempt,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for BillingAccountResponseBillingStatus {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for BillingAccountResponseBillingStatus {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for BillingAccountResponseBillingStatus {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for BillingAccountResponseBillingStatus {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for BillingAccountResponseBillingStatus {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct BillingAccountResponsePaymentMethodSummary {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub stripe_payment_method_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#type: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub brand: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last4: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub exp_month: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub exp_year: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct BillingAccountResponseTaxIdsItem {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#type: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[doc = " A Stripe invoice mirrored into Truto. Stripe remains the system of record; use `hosted_invoice_url` to view or pay it."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct BillingInvoiceResponse {
#[doc = " Truto's id for the mirrored invoice row."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub team_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub stripe_invoice_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub stripe_customer_id: Option<String>,
#[doc = " `automated` when Truto generated it from a plan; `stripe_manual` when it was raised by hand in Stripe."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub source: Option<BillingInvoiceResponseSource>,
#[doc = " Raw Stripe invoice status."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status: Option<BillingInvoiceResponseStatus>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub number: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub currency: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub amount_due_cents: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub amount_paid_cents: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub amount_remaining_cents: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub period_start: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub period_end: Option<String>,
#[doc = " Stripe-hosted page to view and pay the invoice."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub hosted_invoice_url: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub invoice_pdf: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub stripe_created_at: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub finalized_at: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub paid_at: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub voided_at: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub attempt_count: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_payment_error: Option<String>,
}
#[doc = " `automated` when Truto generated it from a plan; `stripe_manual` when it was raised by hand in Stripe."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum BillingInvoiceResponseSource {
#[doc = " `automated`"]
Automated,
#[doc = " `stripe_manual`"]
StripeManual,
/// A value not known to this version of the SDK.
Other(String),
}
impl BillingInvoiceResponseSource {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Automated => "automated",
Self::StripeManual => "stripe_manual",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for BillingInvoiceResponseSource {
fn from(s: &str) -> Self {
match s {
"automated" => Self::Automated,
"stripe_manual" => Self::StripeManual,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for BillingInvoiceResponseSource {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for BillingInvoiceResponseSource {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for BillingInvoiceResponseSource {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for BillingInvoiceResponseSource {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for BillingInvoiceResponseSource {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Raw Stripe invoice status."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum BillingInvoiceResponseStatus {
#[doc = " `draft`"]
Draft,
#[doc = " `open`"]
Open,
#[doc = " `paid`"]
Paid,
#[doc = " `void`"]
Void,
#[doc = " `uncollectible`"]
Uncollectible,
/// A value not known to this version of the SDK.
Other(String),
}
impl BillingInvoiceResponseStatus {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Draft => "draft",
Self::Open => "open",
Self::Paid => "paid",
Self::Void => "void",
Self::Uncollectible => "uncollectible",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for BillingInvoiceResponseStatus {
fn from(s: &str) -> Self {
match s {
"draft" => Self::Draft,
"open" => Self::Open,
"paid" => Self::Paid,
"void" => Self::Void,
"uncollectible" => Self::Uncollectible,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for BillingInvoiceResponseStatus {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for BillingInvoiceResponseStatus {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for BillingInvoiceResponseStatus {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for BillingInvoiceResponseStatus {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for BillingInvoiceResponseStatus {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct BillingLine {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub kind: Option<BillingLineKind>,
#[doc = " Invoice wording. Usage lines mention the included allowance only when the component has one."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[doc = " Units charged; for usage lines the number of blocks of `unit_size`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub quantity: Option<i64>,
#[doc = " Price per charged unit (per block for usage lines)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub unit_price_cents: Option<f64>,
#[doc = " Usage lines only — units per block."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub unit_size: Option<i64>,
#[doc = " Usage lines only — measured minus included, before block rounding."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub overage_quantity: Option<i64>,
#[doc = " Amount before discount."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub gross_amount_cents: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub discount_percent: Option<f64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub discount_cents: Option<i64>,
#[doc = " Net amount charged."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub amount_cents: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub period_start: Option<String>,
#[doc = " Exclusive end (first day of the next period)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub period_end: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub metric: Option<BillingLineMetric>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub measured_quantity: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub included_quantity: Option<i64>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum BillingLineKind {
#[doc = " `base_fee`"]
BaseFee,
#[doc = " `usage`"]
Usage,
#[doc = " `fixed`"]
Fixed,
/// A value not known to this version of the SDK.
Other(String),
}
impl BillingLineKind {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::BaseFee => "base_fee",
Self::Usage => "usage",
Self::Fixed => "fixed",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for BillingLineKind {
fn from(s: &str) -> Self {
match s {
"base_fee" => Self::BaseFee,
"usage" => Self::Usage,
"fixed" => Self::Fixed,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for BillingLineKind {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for BillingLineKind {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for BillingLineKind {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for BillingLineKind {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for BillingLineKind {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum BillingLineMetric {
#[doc = " `connector`"]
Connector,
#[doc = " `active_connection`"]
ActiveConnection,
#[doc = " `api_call`"]
ApiCall,
#[doc = " `superquery_account`"]
SuperqueryAccount,
/// A value not known to this version of the SDK.
Other(String),
}
impl BillingLineMetric {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Connector => "connector",
Self::ActiveConnection => "active_connection",
Self::ApiCall => "api_call",
Self::SuperqueryAccount => "superquery_account",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for BillingLineMetric {
fn from(s: &str) -> Self {
match s {
"connector" => Self::Connector,
"active_connection" => Self::ActiveConnection,
"api_call" => Self::ApiCall,
"superquery_account" => Self::SuperqueryAccount,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for BillingLineMetric {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for BillingLineMetric {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for BillingLineMetric {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for BillingLineMetric {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for BillingLineMetric {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct BillingPlanResponse {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub team_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_active: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub base_fee_cents: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub base_fee_interval: Option<BillingPlanResponseBaseFeeInterval>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub base_fee_anchor_month: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub base_fee_description: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub base_fee_discount_percent: Option<f64>,
#[doc = " `automatic` invoices are generated by the daily billing run on `billing_day`; `manual` plans are invoiced by Truto staff."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub billing_mode: Option<BillingPlanResponseBillingMode>,
#[doc = " Day of the month (UTC) automatic invoices are issued."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub billing_day: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub components: Option<Vec<Value>>,
#[doc = " First calendar month (always the 1st) this plan bills. Everything bills in arrears, so the first invoice is issued on `billing_day` of the following month."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub effective_from: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum BillingPlanResponseBaseFeeInterval {
#[doc = " `month`"]
Month,
#[doc = " `quarter`"]
Quarter,
#[doc = " `half_year`"]
HalfYear,
#[doc = " `year`"]
Year,
/// A value not known to this version of the SDK.
Other(String),
}
impl BillingPlanResponseBaseFeeInterval {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Month => "month",
Self::Quarter => "quarter",
Self::HalfYear => "half_year",
Self::Year => "year",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for BillingPlanResponseBaseFeeInterval {
fn from(s: &str) -> Self {
match s {
"month" => Self::Month,
"quarter" => Self::Quarter,
"half_year" => Self::HalfYear,
"year" => Self::Year,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for BillingPlanResponseBaseFeeInterval {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for BillingPlanResponseBaseFeeInterval {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for BillingPlanResponseBaseFeeInterval {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for BillingPlanResponseBaseFeeInterval {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for BillingPlanResponseBaseFeeInterval {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " `automatic` invoices are generated by the daily billing run on `billing_day`; `manual` plans are invoiced by Truto staff."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum BillingPlanResponseBillingMode {
#[doc = " `automatic`"]
Automatic,
#[doc = " `manual`"]
Manual,
/// A value not known to this version of the SDK.
Other(String),
}
impl BillingPlanResponseBillingMode {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Automatic => "automatic",
Self::Manual => "manual",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for BillingPlanResponseBillingMode {
fn from(s: &str) -> Self {
match s {
"automatic" => Self::Automatic,
"manual" => Self::Manual,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for BillingPlanResponseBillingMode {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for BillingPlanResponseBillingMode {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for BillingPlanResponseBillingMode {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for BillingPlanResponseBillingMode {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for BillingPlanResponseBillingMode {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct BillingSummaryResponse {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub account: Option<BillingAccountResponse>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub plan: Option<BillingPlanResponse>,
#[doc = " Month-to-date charges priced against the plan. Everything — platform fee, fixed items and usage — bills in arrears, so these are invoiced on `invoice_date`, after the month ends. `null` when the team has no active plan."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub current_period: Option<BillingSummaryResponseCurrentPeriod>,
#[doc = " Next date the daily billing run will invoice this team (its plan's `billing_day`). Never earlier than the month after the plan's `effective_from`, since everything bills in arrears. Null for manual or inactive plans."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub next_invoice_date: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_invoice: Option<BillingInvoiceResponse>,
}
#[doc = " Month-to-date charges priced against the plan. Everything — platform fee, fixed items and usage — bills in arrears, so these are invoiced on `invoice_date`, after the month ends. `null` when the team has no active plan."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct BillingSummaryResponseCurrentPeriod {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub period_start: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub period_end: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub usage: Option<BillingSummaryResponseCurrentPeriodUsage>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub lines: Option<Vec<BillingLine>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub estimated_total_cents: Option<i64>,
#[doc = " When these charges are invoiced, the plan's `billing_day` in the month after `period_end`. Null for manual plans and while the plan has not started."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub invoice_date: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct BillingSummaryResponseCurrentPeriodUsage {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub counts: Option<BillingSummaryResponseCurrentPeriodUsageCounts>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub details: Option<Map<String, Value>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct BillingSummaryResponseCurrentPeriodUsageCounts {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub connector: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub active_connection: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub api_call: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub superquery_account: Option<i64>,
}
#[doc = " Consolidated capabilities for an integration or integrated account."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct CapabilitiesResponse {
pub integration: CapabilitiesResponseIntegration,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub account: Option<CapabilityAccount>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub proxy: Option<CapabilitiesResponseProxy>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub unified: Option<CapabilitiesResponseUnified>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub auth: Option<CapabilityAuth>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ai_readiness: Option<CapabilityAiReadiness>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct CapabilitiesResponseIntegration {
pub id: String,
pub slug: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct CapabilitiesResponseProxy {
pub resources: Vec<CapabilityProxyResource>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct CapabilitiesResponseUnified {
pub resources: Vec<CapabilityUnifiedResource>,
}
#[doc = " Present on `/integrated-account/{id}/capabilities` only."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct CapabilityAccount {
pub id: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub slug: Option<String>,
pub status: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authentication_method: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_blocked: Option<bool>,
}
#[doc = " Coverage of proxy methods that have descriptions."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct CapabilityAiReadiness {
pub total_methods: i64,
pub described_methods: i64,
#[doc = " Ratio in `[0, 1]`."]
pub score: f64,
}
#[doc = " Authentication formats and required fields for the integration."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct CapabilityAuth {
pub formats: Vec<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub fields: Option<Vec<CapabilityAuthFieldsItem>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scopes: Option<Vec<String>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub documentation_url: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct CapabilityAuthFieldsItem {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub required: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub format: Option<String>,
}
#[doc = " A single proxy method on a resource."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct CapabilityProxyMethod {
#[doc = " Canonical method name (`list`, `get`, `create`, `update`, `delete`, or a custom name)."]
pub method: String,
#[doc = " MCP tool name for this method. Resolved as: environment-integration `tool_name` documentation override, then integration-level `tool_name` override, then a programmatic default from `getToolName()`."]
pub name: String,
#[doc = " Present and `true` when the method is disabled by an environment override."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub disabled: Option<bool>,
#[doc = " Tool name without environment-integration overrides (base `tool_name` documentation or programmatic default). Same as `name` when no env override applies. Used by the app to revert env-level overrides."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub inherited_name: Option<String>,
#[doc = " Human/AI-facing description, sourced from documentation or inline configuration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<String>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub deprecated: Option<bool>,
}
#[doc = " A proxy resource and the methods it exposes."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct CapabilityProxyResource {
pub name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub docs_url: Option<String>,
pub methods: Vec<CapabilityProxyMethod>,
}
#[doc = " A unified resource grouped under a unified API."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct CapabilityUnifiedResource {
pub api_name: String,
pub name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub docs_url: Option<String>,
pub methods: Vec<CapabilityUnifiedResourceMethodsItem>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum CapabilityUnifiedResourceMethodsItem {
#[doc = " `list`"]
List,
#[doc = " `get`"]
Get,
#[doc = " `create`"]
Create,
#[doc = " `update`"]
Update,
#[doc = " `delete`"]
Delete,
/// A value not known to this version of the SDK.
Other(String),
}
impl CapabilityUnifiedResourceMethodsItem {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::List => "list",
Self::Get => "get",
Self::Create => "create",
Self::Update => "update",
Self::Delete => "delete",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for CapabilityUnifiedResourceMethodsItem {
fn from(s: &str) -> Self {
match s {
"list" => Self::List,
"get" => Self::Get,
"create" => Self::Create,
"update" => Self::Update,
"delete" => Self::Delete,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for CapabilityUnifiedResourceMethodsItem {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for CapabilityUnifiedResourceMethodsItem {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for CapabilityUnifiedResourceMethodsItem {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for CapabilityUnifiedResourceMethodsItem {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for CapabilityUnifiedResourceMethodsItem {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct CategorySchema {
#[doc = " The internal name/slug of the category."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " A user-facing label or descriptive name for the category."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
#[doc = " The date and time when the category was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the category was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
}
#[doc = " Datastore configuration. The shape of `config` depends on the parent record's `type` field. Truto deserializes the `config` blob into one of `DatastoreMongoDataApiConfig`, `DatastoreGoogleCloudStorageConfig`, `DatastoreS3Config`, or `DatastoreQdrantConfig`."]
///
/// Union type: holds the raw JSON and decodes a variant on demand.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(transparent)]
pub struct DatastoreConfig(pub Value);
impl DatastoreConfig {
/// The raw JSON value.
pub fn raw(&self) -> &Value {
&self.0
}
/// Consume the wrapper and return the raw JSON value.
pub fn into_raw(self) -> Value {
self.0
}
/// Decode the value as [`DatastoreMongoDataApiConfig`].
pub fn as_datastore_mongo_data_api_config(&self) -> Result<DatastoreMongoDataApiConfig, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`DatastoreGoogleCloudStorageConfig`].
pub fn as_datastore_google_cloud_storage_config(&self) -> Result<DatastoreGoogleCloudStorageConfig, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`DatastoreS3Config`].
pub fn as_datastore_s3_config(&self) -> Result<DatastoreS3Config, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`DatastoreQdrantConfig`].
pub fn as_datastore_qdrant_config(&self) -> Result<DatastoreQdrantConfig, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
}
impl From<DatastoreMongoDataApiConfig> for DatastoreConfig {
fn from(v: DatastoreMongoDataApiConfig) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<DatastoreGoogleCloudStorageConfig> for DatastoreConfig {
fn from(v: DatastoreGoogleCloudStorageConfig) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<DatastoreS3Config> for DatastoreConfig {
fn from(v: DatastoreS3Config) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<DatastoreQdrantConfig> for DatastoreConfig {
fn from(v: DatastoreQdrantConfig) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<Value> for DatastoreConfig {
fn from(v: Value) -> Self {
Self(v)
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct DatastoreCreateRequest {
#[doc = " The datastore ID (optional; if omitted, one is generated)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The datastore type. Determines the shape of `config`."]
pub r#type: DatastoreCreateRequestType,
#[doc = " A friendly label for this datastore."]
pub label: String,
#[doc = " Config object for the datastore connection. Shape depends on `type`."]
pub config: DatastoreConfig,
#[doc = " The environment that owns this datastore. If omitted, defaults to the user's first environment; required when the user has multiple environments."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[doc = " Optional list of integration methods (e.g. `unified_api/resource/method`) used to validate the datastore configuration before persisting."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub validation_methods: Option<Vec<String>>,
}
#[doc = " The datastore type. Determines the shape of `config`."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum DatastoreCreateRequestType {
#[doc = " `mongo_data_api`"]
MongoDataApi,
#[doc = " `google_cloud_storage`"]
GoogleCloudStorage,
#[doc = " `s3`"]
S3,
#[doc = " `qdrant`"]
Qdrant,
/// A value not known to this version of the SDK.
Other(String),
}
impl DatastoreCreateRequestType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::MongoDataApi => "mongo_data_api",
Self::GoogleCloudStorage => "google_cloud_storage",
Self::S3 => "s3",
Self::Qdrant => "qdrant",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for DatastoreCreateRequestType {
fn from(s: &str) -> Self {
match s {
"mongo_data_api" => Self::MongoDataApi,
"google_cloud_storage" => Self::GoogleCloudStorage,
"s3" => Self::S3,
"qdrant" => Self::Qdrant,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for DatastoreCreateRequestType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for DatastoreCreateRequestType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for DatastoreCreateRequestType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for DatastoreCreateRequestType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for DatastoreCreateRequestType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct DatastoreDeleteResponse {
#[doc = " The ID of the deleted datastore."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
}
#[doc = " Configuration for the Google Cloud Storage datastore type."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct DatastoreGoogleCloudStorageConfig {
pub bucket: String,
pub credentials: DatastoreGoogleCloudStorageCredentials,
}
#[doc = " Service-account JSON used to authenticate against Google Cloud Storage."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct DatastoreGoogleCloudStorageCredentials {
pub r#type: String,
pub project_id: String,
pub private_key_id: String,
pub private_key: String,
pub client_email: String,
pub client_id: String,
pub auth_uri: String,
pub token_uri: String,
pub auth_provider_x509_cert_url: String,
pub client_x509_cert_url: String,
pub universe_domain: String,
}
#[doc = " Configuration for the MongoDB Atlas Data API datastore type."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct DatastoreMongoDataApiConfig {
#[doc = " Name of the Atlas cluster (the Data API \"data source\")."]
pub data_source: String,
pub database: String,
#[doc = " Base URL of your Atlas Data API endpoint."]
pub api_url: String,
#[doc = " Atlas Data API key. Treat as a secret."]
pub api_key: String,
}
#[doc = " Configuration for the Qdrant vector-store datastore type."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct DatastoreQdrantConfig {
pub base_url: String,
#[doc = " Qdrant API key. Treat as a secret."]
pub api_key: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub port: Option<i64>,
pub collection: String,
}
#[doc = " Configuration for the S3 / S3-compatible datastore type."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct DatastoreS3Config {
pub access_key_id: String,
#[doc = " Secret access key. Treat as a secret."]
pub secret_access_key: String,
pub region: String,
pub bucket: String,
#[doc = " Optional override for non-AWS S3 endpoints (e.g. R2, MinIO)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub base_url: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct DatastoreSchema {
#[doc = " The unique ID of the datastore."]
pub id: String,
#[doc = " The datastore's backend type. Determines the shape of `config`."]
pub r#type: DatastoreSchemaType,
#[doc = " A friendly label for identifying this datastore."]
pub label: String,
#[doc = " Config object for the datastore connection (minus sensitive fields). The shape depends on `type`."]
pub config: DatastoreConfig,
#[doc = " The environment to which this datastore belongs."]
pub environment_id: String,
#[doc = " Timestamp when the datastore record was created."]
pub created_at: String,
#[doc = " Timestamp when the datastore record was last updated."]
pub updated_at: String,
}
#[doc = " The datastore's backend type. Determines the shape of `config`."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum DatastoreSchemaType {
#[doc = " `mongo_data_api`"]
MongoDataApi,
#[doc = " `google_cloud_storage`"]
GoogleCloudStorage,
#[doc = " `s3`"]
S3,
#[doc = " `qdrant`"]
Qdrant,
/// A value not known to this version of the SDK.
Other(String),
}
impl DatastoreSchemaType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::MongoDataApi => "mongo_data_api",
Self::GoogleCloudStorage => "google_cloud_storage",
Self::S3 => "s3",
Self::Qdrant => "qdrant",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for DatastoreSchemaType {
fn from(s: &str) -> Self {
match s {
"mongo_data_api" => Self::MongoDataApi,
"google_cloud_storage" => Self::GoogleCloudStorage,
"s3" => Self::S3,
"qdrant" => Self::Qdrant,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for DatastoreSchemaType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for DatastoreSchemaType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for DatastoreSchemaType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for DatastoreSchemaType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for DatastoreSchemaType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct DatastoreUpdateRequest {
#[doc = " New label for this datastore."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
#[doc = " Updated config object. Partial updates are accepted; fields not supplied are left unchanged. Shape still depends on `type`. An update that moves `api_url` (`mongo_data_api`) or `base_url` (`qdrant`) to another site must send `api_key` with it, or it is refused with a `400`. `api_key` sent back as `********` keeps the stored key, so it is refused too."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<DatastoreConfig>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct DeleteResponse {
#[doc = " The ID of the resource that was deleted."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
}
#[doc = " A documentation row attached to an integration, environment integration, or unified model."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct Documentation {
pub id: String,
pub entity_id: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub entity_type: Option<DocumentationEntityType>,
pub r#type: DocumentationType,
#[doc = " Row payload. For `tool_name`, a snake_case MCP tool name override (max 64 chars, `[a-z0-9_]`). For `description`, plain text. For `*_schema` types, YAML-encoded schema."]
pub content: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub method: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authentication_method: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration_name: Option<String>,
pub created_at: String,
pub updated_at: String,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct DocumentationCreateRequest {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_integration_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub unified_model_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_unified_model_id: Option<String>,
pub r#type: DocumentationType,
pub content: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub method: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authentication_method: Option<String>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum DocumentationEntityType {
#[doc = " `integration`"]
Integration,
#[doc = " `unified_model`"]
UnifiedModel,
#[doc = " `environment_integration`"]
EnvironmentIntegration,
#[doc = " `environment_unified_model`"]
EnvironmentUnifiedModel,
/// A value not known to this version of the SDK.
Other(String),
}
impl DocumentationEntityType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Integration => "integration",
Self::UnifiedModel => "unified_model",
Self::EnvironmentIntegration => "environment_integration",
Self::EnvironmentUnifiedModel => "environment_unified_model",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for DocumentationEntityType {
fn from(s: &str) -> Self {
match s {
"integration" => Self::Integration,
"unified_model" => Self::UnifiedModel,
"environment_integration" => Self::EnvironmentIntegration,
"environment_unified_model" => Self::EnvironmentUnifiedModel,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for DocumentationEntityType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for DocumentationEntityType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for DocumentationEntityType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for DocumentationEntityType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for DocumentationEntityType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct DocumentationPatchRequest {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#type: Option<DocumentationType>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub content: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub method: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authentication_method: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration_name: Option<String>,
}
#[doc = " Documentation row type. Per-method MCP tooling uses `description`, `tool_name`, `query_schema`, `body_schema`, and `response_schema`. Integration-wide rows include `readme`, `oauth_*`, and `note`."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum DocumentationType {
#[doc = " `readme`"]
Readme,
#[doc = " `note`"]
Note,
#[doc = " `end_user_guide`"]
EndUserGuide,
#[doc = " `description`"]
Description,
#[doc = " `tool_name`"]
ToolName,
#[doc = " `query_schema`"]
QuerySchema,
#[doc = " `body_schema`"]
BodySchema,
#[doc = " `response_schema`"]
ResponseSchema,
#[doc = " `oauth_documentation_link`"]
OauthDocumentationLink,
#[doc = " `oauth_app_requires_verification`"]
OauthAppRequiresVerification,
#[doc = " `oauth_note`"]
OauthNote,
/// A value not known to this version of the SDK.
Other(String),
}
impl DocumentationType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Readme => "readme",
Self::Note => "note",
Self::EndUserGuide => "end_user_guide",
Self::Description => "description",
Self::ToolName => "tool_name",
Self::QuerySchema => "query_schema",
Self::BodySchema => "body_schema",
Self::ResponseSchema => "response_schema",
Self::OauthDocumentationLink => "oauth_documentation_link",
Self::OauthAppRequiresVerification => "oauth_app_requires_verification",
Self::OauthNote => "oauth_note",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for DocumentationType {
fn from(s: &str) -> Self {
match s {
"readme" => Self::Readme,
"note" => Self::Note,
"end_user_guide" => Self::EndUserGuide,
"description" => Self::Description,
"tool_name" => Self::ToolName,
"query_schema" => Self::QuerySchema,
"body_schema" => Self::BodySchema,
"response_schema" => Self::ResponseSchema,
"oauth_documentation_link" => Self::OauthDocumentationLink,
"oauth_app_requires_verification" => Self::OauthAppRequiresVerification,
"oauth_note" => Self::OauthNote,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for DocumentationType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for DocumentationType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for DocumentationType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for DocumentationType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for DocumentationType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Per-environment configuration override for an integration. Stored on `environment_integration.override` and **deep-merged** on top of the base `integration.config` at request time."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentIntegrationConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub base_url: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub logo: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub icon: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub headers: Option<BTreeMap<String, Option<String>>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query: Option<BTreeMap<String, String>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query_array_format: Option<EnvironmentIntegrationConfigQueryArrayFormat>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub actions: Option<BTreeMap<String, IntegrationAction>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub credentials: Option<Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authorization: Option<IntegrationAuthorization>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pagination: Option<IntegrationPagination>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub rate_limit: Option<IntegrationRateLimit>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resources: Option<BTreeMap<String, BTreeMap<String, Option<EnvironmentIntegrationResourceMethod>>>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tool_tags: Option<BTreeMap<String, Vec<String>>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub webhook: Option<IntegrationWebhookConfig>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error_expression: Option<String>,
#[doc = " Environment-specific description shown in the catalog."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[doc = " Environment-specific tags shown in the catalog."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<String>>,
#[doc = " Environment-specific beta flag shown in the catalog and Connect UI. Deep-merged onto `integration.is_beta` at request time."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_beta: Option<bool>,
#[doc = " Free-form key/value pairs available to JSONata as `{{env.<key>}}` for this integration in this environment. Values can be of any type (string, number, boolean, object, array)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_variables: Option<Map<String, Value>>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum EnvironmentIntegrationConfigQueryArrayFormat {
#[doc = " `comma`"]
Comma,
#[doc = " `brackets`"]
Brackets,
#[doc = " `indices`"]
Indices,
#[doc = " `repeat`"]
Repeat,
/// A value not known to this version of the SDK.
Other(String),
}
impl EnvironmentIntegrationConfigQueryArrayFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Comma => "comma",
Self::Brackets => "brackets",
Self::Indices => "indices",
Self::Repeat => "repeat",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for EnvironmentIntegrationConfigQueryArrayFormat {
fn from(s: &str) -> Self {
match s {
"comma" => Self::Comma,
"brackets" => Self::Brackets,
"indices" => Self::Indices,
"repeat" => Self::Repeat,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for EnvironmentIntegrationConfigQueryArrayFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for EnvironmentIntegrationConfigQueryArrayFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for EnvironmentIntegrationConfigQueryArrayFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for EnvironmentIntegrationConfigQueryArrayFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for EnvironmentIntegrationConfigQueryArrayFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentIntegrationCreateRequest {
#[doc = " The ID of the integration to install."]
pub integration_id: String,
#[doc = " Whether to show this integration in the environment's catalog."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub show_in_catalog: Option<bool>,
#[doc = " Whether the integration should be enabled."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_enabled: Option<bool>,
#[doc = " An optional config override for the integration at environment level. Specify the Integration keys to override at the environment level. Deep-merged on top of the base `integration.config`. Checked as on `PATCH`, so where it keeps the integration's secret (it sends none of its own), it may move a host that secret is sent to only within the site it names or to a host one of the integration's select options gives, may not change such a path (`auth.tokenPath`, `auth.refreshPath`, `auth.revokePath`, or the path of an OAuth 1.0a URL), and each connect-form select keeps to the integration's options; any other move is a `400`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#override: Option<EnvironmentIntegrationConfig>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentIntegrationDeleteResponse {
#[doc = " The ID of the environment integration that was deleted."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
}
#[doc = " Per-integration configuration for the embedded **connections widget**, and nothing else. It is never merged into `integration.config`, so it cannot affect proxy, unified or custom requests."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentIntegrationLinkUiConfig {
#[doc = " Restricts which tenants may see and connect this integration. Omitted or `null` means every tenant sees it, which is the default for every integration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub visible_when: Option<TenantVisibility>,
#[doc = " Overrides `integration.category` as this card's grouping key in the widget."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub group: Option<String>,
#[doc = " Overrides the widget's Connect button label for this integration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub connect_label: Option<String>,
#[doc = " Overrides the widget's Configure button label for this integration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub configure_label: Option<String>,
}
#[doc = " Per-environment override for a single resource method. Same shape as `IntegrationResourceMethod` but every field is optional (deep-merged on top of the base method). `path` is also optional here."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentIntegrationResourceMethod {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub base_url: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub method: Option<EnvironmentIntegrationResourceMethodMethod>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub path: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pagination_path: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authorization: Option<IntegrationAuthorization>,
#[doc = " Override or add request headers for this method. Values may include JSONata placeholders."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub headers: Option<Map<String, Value>>,
#[doc = " Override or add query params for this method. Values may include JSONata placeholders."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query: Option<Map<String, Value>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query_array_format: Option<EnvironmentIntegrationResourceMethodQueryArrayFormat>,
#[doc = " Override the query schema. May be a JSONata string or a `JsonSchemaObject`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query_schema: Option<Value>,
#[doc = " Override the body schema. May be a JSONata string or a `JsonSchemaObject`. See `IntegrationResourceMethod.body_schema` for shape rationale."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body_schema: Option<Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body_format: Option<EnvironmentIntegrationResourceMethodBodyFormat>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body_format_config: Option<Map<String, Value>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response_schema: Option<Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response_path: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pagination: Option<IntegrationPagination>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub add_query_to_body: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ignore_body_in_pagination: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ignore_body: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub set_body_to_null: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub no_auth: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub examples: Option<IntegrationResourceMethodExample>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ignore_credentials_on_redirect: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub api_response_format: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub throw_error_on_parse_error: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error_expression: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub api_documentation_url: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scopes: Option<Vec<String>>,
#[doc = " Per-environment override for the any-of half of the requirement. See `IntegrationResourceMethod.scopes_any_of`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scopes_any_of: Option<Vec<String>>,
#[doc = " Per-environment override for which vocabulary `scopes` and `scopes_any_of` are written in. See `IntegrationResourceMethod.permission_vocabulary` for what the values mean and why the field normally stays unset. Overriding it here corrects one environment without touching the base integration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub permission_vocabulary: Option<EnvironmentIntegrationResourceMethodPermissionVocabulary>,
#[doc = " Per-environment override for the method's MCP `ToolAnnotations` hints. See `IntegrationResourceMethod.mcp_annotations`. Absent means \"no hint\". Hints merge per key with the base method, so to tighten a base read to destructive the override must also set `readOnlyHint: false`; a merged object with both `true` is treated as no hint."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mcp_annotations: Option<EnvironmentIntegrationResourceMethodMcpAnnotations>,
#[doc = " Per-environment override for the method's `before` steps. See `IntegrationResourceMethod.before`. Arrays are replaced wholesale, not merged per step, so an override of `[]` clears the base method's `before` for this environment. Stored only; Truto's own proxy does not run it yet."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub before: Option<Value>,
#[doc = " Override the request body for this method. Any JSON value; may include JSONata placeholders."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body: Option<Value>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum EnvironmentIntegrationResourceMethodBodyFormat {
#[doc = " `json`"]
Json,
#[doc = " `form`"]
Form,
#[doc = " `multipart`"]
Multipart,
#[doc = " `raw`"]
Raw,
#[doc = " `xml`"]
Xml,
/// A value not known to this version of the SDK.
Other(String),
}
impl EnvironmentIntegrationResourceMethodBodyFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Json => "json",
Self::Form => "form",
Self::Multipart => "multipart",
Self::Raw => "raw",
Self::Xml => "xml",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for EnvironmentIntegrationResourceMethodBodyFormat {
fn from(s: &str) -> Self {
match s {
"json" => Self::Json,
"form" => Self::Form,
"multipart" => Self::Multipart,
"raw" => Self::Raw,
"xml" => Self::Xml,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for EnvironmentIntegrationResourceMethodBodyFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for EnvironmentIntegrationResourceMethodBodyFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for EnvironmentIntegrationResourceMethodBodyFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for EnvironmentIntegrationResourceMethodBodyFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for EnvironmentIntegrationResourceMethodBodyFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Per-environment override for the method's MCP `ToolAnnotations` hints. See `IntegrationResourceMethod.mcp_annotations`. Absent means \"no hint\". Hints merge per key with the base method, so to tighten a base read to destructive the override must also set `readOnlyHint: false`; a merged object with both `true` is treated as no hint."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentIntegrationResourceMethodMcpAnnotations {
#[doc = " The tool does not modify its environment."]
#[serde(rename = "readOnlyHint")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub read_only_hint: Option<bool>,
#[doc = " The tool may perform destructive updates (as opposed to purely additive ones)."]
#[serde(rename = "destructiveHint")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub destructive_hint: Option<bool>,
#[doc = " Calling the tool repeatedly with the same arguments has no additional effect."]
#[serde(rename = "idempotentHint")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub idempotent_hint: Option<bool>,
#[doc = " The tool interacts with an open world of external entities (as opposed to a closed domain)."]
#[serde(rename = "openWorldHint")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub open_world_hint: Option<bool>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum EnvironmentIntegrationResourceMethodMethod {
#[doc = " `get`"]
Get,
#[doc = " `post`"]
Post,
#[doc = " `put`"]
Put,
#[doc = " `patch`"]
Patch,
#[doc = " `delete`"]
Delete,
#[doc = " `options`"]
Options,
#[doc = " `propfind`"]
Propfind,
#[doc = " `report`"]
Report,
#[doc = " `proppatch`"]
Proppatch,
#[doc = " `mkcalendar`"]
Mkcalendar,
#[doc = " `mkcol`"]
Mkcol,
/// A value not known to this version of the SDK.
Other(String),
}
impl EnvironmentIntegrationResourceMethodMethod {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Get => "get",
Self::Post => "post",
Self::Put => "put",
Self::Patch => "patch",
Self::Delete => "delete",
Self::Options => "options",
Self::Propfind => "propfind",
Self::Report => "report",
Self::Proppatch => "proppatch",
Self::Mkcalendar => "mkcalendar",
Self::Mkcol => "mkcol",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for EnvironmentIntegrationResourceMethodMethod {
fn from(s: &str) -> Self {
match s {
"get" => Self::Get,
"post" => Self::Post,
"put" => Self::Put,
"patch" => Self::Patch,
"delete" => Self::Delete,
"options" => Self::Options,
"propfind" => Self::Propfind,
"report" => Self::Report,
"proppatch" => Self::Proppatch,
"mkcalendar" => Self::Mkcalendar,
"mkcol" => Self::Mkcol,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for EnvironmentIntegrationResourceMethodMethod {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for EnvironmentIntegrationResourceMethodMethod {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for EnvironmentIntegrationResourceMethodMethod {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for EnvironmentIntegrationResourceMethodMethod {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for EnvironmentIntegrationResourceMethodMethod {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Per-environment override for which vocabulary `scopes` and `scopes_any_of` are written in. See `IntegrationResourceMethod.permission_vocabulary` for what the values mean and why the field normally stays unset. Overriding it here corrects one environment without touching the base integration."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum EnvironmentIntegrationResourceMethodPermissionVocabulary {
#[doc = " `oauth_scope`"]
OauthScope,
#[doc = " `api_key_permission`"]
ApiKeyPermission,
#[doc = " `role_label`"]
RoleLabel,
/// A value not known to this version of the SDK.
Other(String),
}
impl EnvironmentIntegrationResourceMethodPermissionVocabulary {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::OauthScope => "oauth_scope",
Self::ApiKeyPermission => "api_key_permission",
Self::RoleLabel => "role_label",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for EnvironmentIntegrationResourceMethodPermissionVocabulary {
fn from(s: &str) -> Self {
match s {
"oauth_scope" => Self::OauthScope,
"api_key_permission" => Self::ApiKeyPermission,
"role_label" => Self::RoleLabel,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for EnvironmentIntegrationResourceMethodPermissionVocabulary {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for EnvironmentIntegrationResourceMethodPermissionVocabulary {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for EnvironmentIntegrationResourceMethodPermissionVocabulary {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for EnvironmentIntegrationResourceMethodPermissionVocabulary {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for EnvironmentIntegrationResourceMethodPermissionVocabulary {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum EnvironmentIntegrationResourceMethodQueryArrayFormat {
#[doc = " `comma`"]
Comma,
#[doc = " `brackets`"]
Brackets,
#[doc = " `indices`"]
Indices,
#[doc = " `repeat`"]
Repeat,
/// A value not known to this version of the SDK.
Other(String),
}
impl EnvironmentIntegrationResourceMethodQueryArrayFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Comma => "comma",
Self::Brackets => "brackets",
Self::Indices => "indices",
Self::Repeat => "repeat",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for EnvironmentIntegrationResourceMethodQueryArrayFormat {
fn from(s: &str) -> Self {
match s {
"comma" => Self::Comma,
"brackets" => Self::Brackets,
"indices" => Self::Indices,
"repeat" => Self::Repeat,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for EnvironmentIntegrationResourceMethodQueryArrayFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for EnvironmentIntegrationResourceMethodQueryArrayFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for EnvironmentIntegrationResourceMethodQueryArrayFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for EnvironmentIntegrationResourceMethodQueryArrayFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for EnvironmentIntegrationResourceMethodQueryArrayFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentIntegrationResponse {
#[doc = " The ID of the environment integration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The ID of the integration this environment integration references."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration_id: Option<String>,
#[doc = " The ID of the environment in which this integration is installed."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[doc = " Whether this integration is shown in the environment's catalog."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub show_in_catalog: Option<bool>,
#[doc = " Whether this integration is enabled in the environment."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_enabled: Option<bool>,
#[doc = " The date and time when the environment integration was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the environment integration was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
#[doc = " The referenced integration object."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration: Option<IntegrationResponse>,
#[doc = " An optional config override applied for the integration at environment level. Deep-merged on top of the base `integration.config` at request time."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#override: Option<EnvironmentIntegrationConfig>,
#[doc = " Connections-widget-only configuration for this integration. Never merged into `integration.config`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub link_ui_config: Option<EnvironmentIntegrationLinkUiConfig>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentIntegrationUpdateRequest {
#[doc = " Whether to show this integration in the environment's catalog."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub show_in_catalog: Option<bool>,
#[doc = " Whether the integration is enabled."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_enabled: Option<bool>,
#[doc = " An optional config override for the integration at environment level. Deep-merged on top of the base `integration.config`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#override: Option<EnvironmentIntegrationConfig>,
#[doc = " Connections-widget configuration for this integration. **Replaced wholesale**, exactly like `override` — send the complete object every time, or `null` to clear it. An unknown key is a `400`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub link_ui_config: Option<EnvironmentIntegrationLinkUiConfig>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentResponse {
#[doc = " The ID of the environment."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The name of the environment."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " The ID of the team that owns this environment."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub team_id: Option<String>,
#[doc = " The date and time when the environment was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the environment was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentUnifiedModelCreateRequest {
#[doc = " The ID of the unified model to install."]
pub unified_model_id: String,
#[doc = " Optional override object for resources, scopes, webhooks, or docs. Deep-merged on top of the base unified model."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#override: Option<EnvironmentUnifiedModelOverride>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentUnifiedModelDeleteResponse {
#[doc = " The ID of the deleted environment-unified-model record."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
}
#[doc = " Per-integration documentation overrides surfaced via `GET /unified/meta/{model_name}/{integration_name}`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentUnifiedModelDocs {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pricing_plan: Option<Vec<String>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub user_role: Option<Vec<String>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scopes: Option<Vec<String>>,
#[doc = " Markdown-formatted integration-specific instructions."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub instructions: Option<String>,
}
#[doc = " A single `before` / `after` step. Used by unified-model resource methods, where Truto runs it around the main HTTP request, and by `before` on proxy resource methods (`IntegrationResourceMethod.before`), where Truto only stores it for engines that run proxy configs."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentUnifiedModelMappingStep {
#[doc = " Step kind. `request` performs an HTTP call against any integration resource; `state`/`replace_data` are reserved for runtime state mutation."]
pub r#type: EnvironmentUnifiedModelMappingStepType,
#[doc = " Optional step identifier referenced from later steps via `{{steps.<name>.response}}`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " JSONata expression; if it evaluates to falsy the step is skipped."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub run_if: Option<String>,
#[doc = " Optional fixed delay (in milliseconds) before the step runs."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub delay_ms: Option<f64>,
#[doc = " Step-specific config. For `request` on a unified-model method, the same shape as a unified-model integration mapping (`resource`, `method`, `query_mapping`, `body_mapping`, etc.)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<Value>,
}
#[doc = " Step kind. `request` performs an HTTP call against any integration resource; `state`/`replace_data` are reserved for runtime state mutation."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum EnvironmentUnifiedModelMappingStepType {
#[doc = " `request`"]
Request,
#[doc = " `state`"]
State,
#[doc = " `replace_data`"]
ReplaceData,
/// A value not known to this version of the SDK.
Other(String),
}
impl EnvironmentUnifiedModelMappingStepType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Request => "request",
Self::State => "state",
Self::ReplaceData => "replace_data",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for EnvironmentUnifiedModelMappingStepType {
fn from(s: &str) -> Self {
match s {
"request" => Self::Request,
"state" => Self::State,
"replace_data" => Self::ReplaceData,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for EnvironmentUnifiedModelMappingStepType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for EnvironmentUnifiedModelMappingStepType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for EnvironmentUnifiedModelMappingStepType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for EnvironmentUnifiedModelMappingStepType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for EnvironmentUnifiedModelMappingStepType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Per-environment override for a unified-model installation. Stored on `environment_unified_model.override` and deep-merged on top of the base `unified_model`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentUnifiedModelOverride {
#[doc = " Resource-level overrides keyed by resource name."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resources: Option<BTreeMap<String, Option<EnvironmentUnifiedModelResourceOverride>>>,
#[doc = " Per-integration extra OAuth scopes appended to the base unified-model scopes."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scopes: Option<BTreeMap<String, Vec<String>>>,
#[doc = " Per-integration JSONata expressions that route inbound webhooks to unified-model resources."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub webhooks: Option<BTreeMap<String, String>>,
#[doc = " Per-integration documentation overrides."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub docs: Option<BTreeMap<String, EnvironmentUnifiedModelDocs>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentUnifiedModelResourceMethodCreateRequest {
#[doc = " The `environment_unified_model` record to attach the override to — get it from `GET /environment-unified-model?unified_model_id=…`. Must belong to an environment you have access to."]
pub environment_unified_model_id: String,
#[doc = " The unified resource name (e.g. `contacts`)."]
pub resource_name: String,
#[doc = " The integration slug (e.g. `apollo`)."]
pub integration_name: String,
#[doc = " The unified method name (`list`, `get`, `create`, `update`, `delete`, or a custom method)."]
pub method_name: String,
#[doc = " The override mapping for this method, deep-merged on top of the base mapping."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<UnifiedModelResourceMethod>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentUnifiedModelResourceMethodDeleteResponse {
#[doc = " The ID of the deleted override row."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
}
#[doc = " Per-environment override for a single unified-model resource method (e.g. `crm.contacts.list` on `salesforce`)."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentUnifiedModelResourceMethodOverride {
#[doc = " Static value returned for this method without making an HTTP call. Useful for stubbing."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#static: Option<Value>,
#[doc = " Override which integration resource this method points to. Either a resource name, an array of resource fragments to merge, or `{ expression, resources }` to pick dynamically."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource: Option<Value>,
#[doc = " Override which integration method this maps to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub method: Option<Value>,
#[doc = " JSONata expression returning a per-call base URL override."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub base_url_mapping: Option<String>,
#[doc = " JSONata expression returning a per-call path override."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub path_mapping: Option<String>,
#[doc = " JSONata expression returning an error message when the upstream response should be treated as an error."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error_mapping: Option<String>,
#[doc = " Mapping schema version. `2` opts into object-form mappings (`*_schema` fields); omit (`undefined`) for legacy string-form mappings (`*_mapping` fields)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mapping_version: Option<f64>,
#[doc = " For object-form mappings, whether the response represents a single item or an array."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response_mapping_method: Option<EnvironmentUnifiedModelResourceMethodOverrideResponseMappingMethod>,
#[doc = " JSONata expression (string) or object-form mapping that transforms the integration response into the unified-model shape."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response_mapping: Option<Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub documentation_link: Option<String>,
#[doc = " Sub-fetches that run after the main request to enrich the response. Either a JSONata string or an array of related-resource configs."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub related_resources: Option<Value>,
#[doc = " Object-form (v2) request body schema (JSON-schema-style with embedded mappings)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub request_body_schema: Option<BTreeMap<String, JsonSchemaObjectProperties>>,
#[doc = " Legacy (v1) string-form request body mapping, OR object-form (v2) request body mapping."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub request_body_mapping: Option<Value>,
#[doc = " Legacy (v1) string-form query mapping, OR object-form (v2) query mapping."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query_mapping: Option<Value>,
#[doc = " Object-form (v2) query schema."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query_schema: Option<Value>,
#[doc = " JSONata expression that transforms the unified-API request headers before sending."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub request_header_mapping: Option<String>,
#[doc = " JSONata expression that transforms the integration response headers before returning."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response_header_mapping: Option<String>,
#[doc = " Static query params merged into the integration request. Values may be templated JSONata expressions."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query: Option<Map<String, Value>>,
#[doc = " Static body merged into the integration request. Values may be templated JSONata expressions."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body: Option<Map<String, Value>>,
#[doc = " Pre-request steps. Either a JSONata string for inline transforms or an array of `EnvironmentUnifiedModelMappingStep`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub before: Option<Value>,
#[doc = " Post-response steps."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub after: Option<Value>,
#[doc = " Marks the response as partial; downstream sync engines will treat missing fields as \"unknown\" rather than \"deleted\"."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_partial_response: Option<bool>,
#[doc = " JSONata expression that returns true when the response should be considered partial."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_partial_expression: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub side_load: Option<BTreeMap<String, EnvironmentUnifiedModelSideLoad>>,
#[doc = " File-upload strategy for `create`/`update` methods that accept files."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub file_upload: Option<Value>,
}
#[doc = " For object-form mappings, whether the response represents a single item or an array."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum EnvironmentUnifiedModelResourceMethodOverrideResponseMappingMethod {
#[doc = " `array`"]
Array,
#[doc = " `item`"]
Item,
/// A value not known to this version of the SDK.
Other(String),
}
impl EnvironmentUnifiedModelResourceMethodOverrideResponseMappingMethod {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Array => "array",
Self::Item => "item",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for EnvironmentUnifiedModelResourceMethodOverrideResponseMappingMethod {
fn from(s: &str) -> Self {
match s {
"array" => Self::Array,
"item" => Self::Item,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for EnvironmentUnifiedModelResourceMethodOverrideResponseMappingMethod {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for EnvironmentUnifiedModelResourceMethodOverrideResponseMappingMethod {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for EnvironmentUnifiedModelResourceMethodOverrideResponseMappingMethod {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for EnvironmentUnifiedModelResourceMethodOverrideResponseMappingMethod {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for EnvironmentUnifiedModelResourceMethodOverrideResponseMappingMethod {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " One row of the `environment_unified_model_resource_method` table — an **environment-scoped** override of a single unified-model mapping. Writing here changes behaviour only for the environment that owns the parent `environment_unified_model` record; the base `unified_model_resource_method` row (and therefore every other environment) is untouched."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentUnifiedModelResourceMethodRowResponse {
#[doc = " The ID of the environment resource-method override row."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The `environment_unified_model` record (environment + unified model pair) this override belongs to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_unified_model_id: Option<String>,
#[doc = " The unified resource this override serves (e.g. `contacts`)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource_name: Option<String>,
#[doc = " The integration slug this override serves (e.g. `apollo`)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration_name: Option<String>,
#[doc = " The unified method this override serves (`list`, `get`, `create`, `update`, `delete`, or a custom method name)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub method_name: Option<String>,
#[doc = " The override mapping, deep-merged on top of the base `unified_model_resource_method` config for the same (resource, integration, method) triple."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<UnifiedModelResourceMethod>,
#[doc = " Optimistic-concurrency version. Send the current value in a PATCH body; every write increments it."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub version: Option<f64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentUnifiedModelResourceMethodUpdateRequest {
#[doc = " Move the override to a different unified resource."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource_name: Option<String>,
#[doc = " Move the override to a different integration slug."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration_name: Option<String>,
#[doc = " Move the override to a different unified method."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub method_name: Option<String>,
#[doc = " The replacement override mapping."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<UnifiedModelResourceMethod>,
#[doc = " The row's current version. Required to avoid clobbering a concurrent write."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub version: Option<f64>,
}
#[doc = " Per-environment override for a single unified-model resource (e.g. `contacts` in the `crm` model)."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentUnifiedModelResourceOverride {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[doc = " Partial JSON schema for the resource. Field-merged on top of the base resource schema."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub schema: Option<JsonSchemaObject>,
#[doc = " Overrides per integration → per method."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration_mapping: Option<BTreeMap<String, BTreeMap<String, EnvironmentUnifiedModelResourceMethodOverride>>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentUnifiedModelResponse {
#[doc = " The ID of the environment-unified-model record."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The ID of the unified model being installed or overridden."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub unified_model_id: Option<String>,
#[doc = " The ID of the environment where this unified model is installed."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[doc = " An optional object containing environment-level overrides for the unified model. Deep-merged on top of the base unified model. See `EnvironmentUnifiedModelOverride` for the typed shape."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#override: Option<EnvironmentUnifiedModelOverride>,
#[doc = " Timestamp when this record was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " Timestamp when this record was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
#[doc = " The full unified model object, with any overrides merged in."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub unified_model: Option<UnifiedModelResponse>,
}
#[doc = " Side-load configuration that fetches related records and merges them into the response under `path`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentUnifiedModelSideLoad {
#[doc = " JSON path inside the unified response where the side-loaded data should be attached."]
pub path: Vec<String>,
#[doc = " JSONata expression that produces the side-loaded value from the related record."]
pub response_mapping: String,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct EnvironmentUnifiedModelUpdateRequest {
#[doc = " The updated override object. Deep-merged on top of the base unified model."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#override: Option<EnvironmentUnifiedModelOverride>,
}
#[doc = " Present on a 403 from the provider, on both the Unified and Proxy APIs. Not every 403 is a scope problem: `value.refusal_basis` states what Truto can say the refusal rests on."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct ForbiddenErrorInsightSchema {
#[doc = " A sentence derived from `value.refusal_basis`, safe to show a reader as-is."]
pub description: String,
pub resource: String,
pub method: String,
pub value: ForbiddenErrorInsightSchemaValue,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct ForbiddenErrorInsightSchemaValue {
#[doc = " Always present. **Treat this as an open set**: the values below are the ones Truto emits today, and the read path deliberately accepts an unrecognised one so a newly shipped state cannot break a client — or an older Truto build — that has not heard of it. Generate a permissive type from it and keep a default branch."]
pub refusal_basis: ForbiddenErrorInsightSchemaValueRefusalBasis,
#[doc = " Declared all-of scopes absent from the grant. Present only for `scopes_missing` and `scopes_satisfied`. Do not default an absent value to `[]` — absent means no comparison ran, which is not the same statement as \"nothing is missing\"."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub missing_scopes: Option<Vec<String>>,
#[doc = " Scopes of which the operation needs any one, where the grant holds none."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub missing_any_of_scopes: Option<Vec<String>>,
#[doc = " What the operation requires, whether or not a comparison was possible. Always paired with `permission_vocabulary`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub required_permissions: Option<Vec<String>>,
#[doc = " Permissions of which the operation needs any one."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub required_any_of_permissions: Option<Vec<String>>,
#[doc = " Which vocabulary the required permissions are written in, and therefore what the remedy is. Only `oauth_scope` is fixed by reconnecting."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub permission_vocabulary: Option<ForbiddenErrorInsightSchemaValuePermissionVocabulary>,
}
#[doc = " Which vocabulary the required permissions are written in, and therefore what the remedy is. Only `oauth_scope` is fixed by reconnecting."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ForbiddenErrorInsightSchemaValuePermissionVocabulary {
#[doc = " `oauth_scope`"]
OauthScope,
#[doc = " `api_key_permission`"]
ApiKeyPermission,
#[doc = " `role_label`"]
RoleLabel,
/// A value not known to this version of the SDK.
Other(String),
}
impl ForbiddenErrorInsightSchemaValuePermissionVocabulary {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::OauthScope => "oauth_scope",
Self::ApiKeyPermission => "api_key_permission",
Self::RoleLabel => "role_label",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for ForbiddenErrorInsightSchemaValuePermissionVocabulary {
fn from(s: &str) -> Self {
match s {
"oauth_scope" => Self::OauthScope,
"api_key_permission" => Self::ApiKeyPermission,
"role_label" => Self::RoleLabel,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for ForbiddenErrorInsightSchemaValuePermissionVocabulary {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for ForbiddenErrorInsightSchemaValuePermissionVocabulary {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for ForbiddenErrorInsightSchemaValuePermissionVocabulary {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for ForbiddenErrorInsightSchemaValuePermissionVocabulary {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for ForbiddenErrorInsightSchemaValuePermissionVocabulary {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Always present. **Treat this as an open set**: the values below are the ones Truto emits today, and the read path deliberately accepts an unrecognised one so a newly shipped state cannot break a client — or an older Truto build — that has not heard of it. Generate a permissive type from it and keep a default branch."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ForbiddenErrorInsightSchemaValueRefusalBasis {
#[doc = " `scopes_missing`"]
ScopesMissing,
#[doc = " `scopes_satisfied`"]
ScopesSatisfied,
#[doc = " `non_scope_requirement`"]
NonScopeRequirement,
#[doc = " `no_scope_concept`"]
NoScopeConcept,
#[doc = " `not_determined`"]
NotDetermined,
/// A value not known to this version of the SDK.
Other(String),
}
impl ForbiddenErrorInsightSchemaValueRefusalBasis {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::ScopesMissing => "scopes_missing",
Self::ScopesSatisfied => "scopes_satisfied",
Self::NonScopeRequirement => "non_scope_requirement",
Self::NoScopeConcept => "no_scope_concept",
Self::NotDetermined => "not_determined",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for ForbiddenErrorInsightSchemaValueRefusalBasis {
fn from(s: &str) -> Self {
match s {
"scopes_missing" => Self::ScopesMissing,
"scopes_satisfied" => Self::ScopesSatisfied,
"non_scope_requirement" => Self::NonScopeRequirement,
"no_scope_concept" => Self::NoScopeConcept,
"not_determined" => Self::NotDetermined,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for ForbiddenErrorInsightSchemaValueRefusalBasis {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for ForbiddenErrorInsightSchemaValueRefusalBasis {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for ForbiddenErrorInsightSchemaValueRefusalBasis {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for ForbiddenErrorInsightSchemaValueRefusalBasis {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for ForbiddenErrorInsightSchemaValueRefusalBasis {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct GroupMappingResponse {
#[doc = " The ID of the group mapping."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The ID of the team that owns this group mapping."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub team_id: Option<String>,
#[doc = " The ID of the SCIM group this mapping applies to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scim_group_id: Option<String>,
#[doc = " The role granted to members of the mapped SCIM group. Null leaves the role unchanged."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub role: Option<GroupMappingResponseRole>,
#[doc = " Environment IDs that members of the mapped group are granted access to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_ids: Option<Vec<String>>,
#[doc = " The date and time when the group mapping was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the group mapping was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
}
#[doc = " The role granted to members of the mapped SCIM group. Null leaves the role unchanged."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum GroupMappingResponseRole {
#[doc = " `admin`"]
Admin,
#[doc = " `member`"]
Member,
/// A value not known to this version of the SDK.
Other(String),
}
impl GroupMappingResponseRole {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Admin => "admin",
Self::Member => "member",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for GroupMappingResponseRole {
fn from(s: &str) -> Self {
match s {
"admin" => Self::Admin,
"member" => Self::Member,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for GroupMappingResponseRole {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for GroupMappingResponseRole {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for GroupMappingResponseRole {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for GroupMappingResponseRole {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for GroupMappingResponseRole {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " HTTP request/response context shared by log types that originate from an inbound HTTP request (`unified_proxy_api` and `mcp`)."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct HttpRequestFields {
#[doc = " The hostname that served the request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub host: Option<String>,
#[doc = " The full URL of the request (with sensitive paths masked)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_url: Option<String>,
#[doc = " The HTTP status code of the response."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_status_code: Option<i64>,
#[doc = " The HTTP method of the request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_method: Option<String>,
#[doc = " The IP address of the client."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_ip: Option<String>,
#[doc = " The Cloudflare Ray ID for the request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_request_id: Option<String>,
#[doc = " The country code of the client (from Cloudflare)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_country: Option<String>,
#[doc = " The User-Agent header of the request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_useragent: Option<String>,
#[doc = " The hostname portion of the request URL."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_url_details_host: Option<String>,
#[doc = " The path portion of the request URL. On `mcp` rows the token segment is masked in full, so the value is always `/mcp/[redacted]` and identifies nothing — use `mcp_server_id` / `mcp_server_name` instead."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_url_details_path: Option<String>,
#[doc = " The parsed query string parameters of the request URL."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_url_details_query_string: Option<Map<String, Value>>,
#[doc = " The URL scheme."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_url_details_scheme: Option<String>,
#[doc = " The HTTP protocol version."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_version: Option<String>,
#[doc = " How the request was authenticated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authentication_type: Option<HttpRequestFieldsAuthenticationType>,
#[doc = " The ID of the authenticated user, if applicable."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub user_id: Option<String>,
#[doc = " The response headers returned to the client."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response_headers: Option<BTreeMap<String, String>>,
}
#[doc = " How the request was authenticated."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum HttpRequestFieldsAuthenticationType {
#[doc = " `session`"]
Session,
#[doc = " `api_token`"]
ApiToken,
#[doc = " `integrated_account`"]
IntegratedAccount,
/// A value not known to this version of the SDK.
Other(String),
}
impl HttpRequestFieldsAuthenticationType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Session => "session",
Self::ApiToken => "api_token",
Self::IntegratedAccount => "integrated_account",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for HttpRequestFieldsAuthenticationType {
fn from(s: &str) -> Self {
match s {
"session" => Self::Session,
"api_token" => Self::ApiToken,
"integrated_account" => Self::IntegratedAccount,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for HttpRequestFieldsAuthenticationType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for HttpRequestFieldsAuthenticationType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for HttpRequestFieldsAuthenticationType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for HttpRequestFieldsAuthenticationType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for HttpRequestFieldsAuthenticationType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccount {
#[doc = " The ID of the integrated account."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The ID of the tenant."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tenant_id: Option<String>,
#[doc = " The ID of the environment integration (installed integration)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_integration_id: Option<String>,
#[doc = " The context of the integrated account. You can find these in the `Variables` section of an integrated account in the Truto UI."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub context: Option<Map<String, Value>>,
#[doc = " Status of the integrated account."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status: Option<IntegratedAccountStatus>,
#[doc = " The last error that occurred while running the post install or validation steps."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_error: Option<String>,
#[doc = " Details of the most recent `403 Forbidden` returned by the third-party API for this account, or `null` if the most recent call succeeded. Cleared automatically on the next successful call."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_forbidden_error: Option<IntegratedAccountLastForbiddenError>,
#[doc = " The results of the post install and validation steps that ran on the integrated account."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_action_result: Option<Map<String, Value>>,
#[doc = " The date and time when the integrated account was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the integrated account was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
#[doc = " Whether the integrated account is in sandbox mode or not. Sandbox integrated accounts do not allow any \"write\" operations."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_sandbox: Option<bool>,
#[doc = " Type of authentication used."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authentication_method: Option<IntegratedAccountAuthenticationMethod>,
#[doc = " The region where the integrated account is placed."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub region: Option<IntegratedAccountRegion>,
}
#[doc = " Type of authentication used."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegratedAccountAuthenticationMethod {
#[doc = " `oauth2`"]
Oauth2,
#[doc = " `oauth`"]
Oauth,
#[doc = " `api_key`"]
ApiKey,
#[doc = " `oauth2_client_credentials`"]
Oauth2ClientCredentials,
#[doc = " `keka_oauth`"]
KekaOauth,
#[doc = " `jwt_bearer`"]
JwtBearer,
#[doc = " `aws_sts`"]
AwsSts,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegratedAccountAuthenticationMethod {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Oauth2 => "oauth2",
Self::Oauth => "oauth",
Self::ApiKey => "api_key",
Self::Oauth2ClientCredentials => "oauth2_client_credentials",
Self::KekaOauth => "keka_oauth",
Self::JwtBearer => "jwt_bearer",
Self::AwsSts => "aws_sts",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegratedAccountAuthenticationMethod {
fn from(s: &str) -> Self {
match s {
"oauth2" => Self::Oauth2,
"oauth" => Self::Oauth,
"api_key" => Self::ApiKey,
"oauth2_client_credentials" => Self::Oauth2ClientCredentials,
"keka_oauth" => Self::KekaOauth,
"jwt_bearer" => Self::JwtBearer,
"aws_sts" => Self::AwsSts,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegratedAccountAuthenticationMethod {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegratedAccountAuthenticationMethod {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegratedAccountAuthenticationMethod {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegratedAccountAuthenticationMethod {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegratedAccountAuthenticationMethod {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountCreate {
#[doc = " The ID of the tenant."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tenant_id: Option<String>,
#[doc = " The ID of the environment integration (installed integration)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_integration_id: Option<String>,
#[doc = " The context of the integrated account."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub context: Option<Map<String, Value>>,
#[doc = " Type of authentication used."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authentication_method: Option<IntegratedAccountCreateAuthenticationMethod>,
#[doc = " The region where the integrated account is placed."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub region: Option<IntegratedAccountCreateRegion>,
}
#[doc = " Type of authentication used."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegratedAccountCreateAuthenticationMethod {
#[doc = " `oauth2`"]
Oauth2,
#[doc = " `oauth`"]
Oauth,
#[doc = " `api_key`"]
ApiKey,
#[doc = " `oauth2_client_credentials`"]
Oauth2ClientCredentials,
#[doc = " `keka_oauth`"]
KekaOauth,
#[doc = " `jwt_bearer`"]
JwtBearer,
#[doc = " `aws_sts`"]
AwsSts,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegratedAccountCreateAuthenticationMethod {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Oauth2 => "oauth2",
Self::Oauth => "oauth",
Self::ApiKey => "api_key",
Self::Oauth2ClientCredentials => "oauth2_client_credentials",
Self::KekaOauth => "keka_oauth",
Self::JwtBearer => "jwt_bearer",
Self::AwsSts => "aws_sts",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegratedAccountCreateAuthenticationMethod {
fn from(s: &str) -> Self {
match s {
"oauth2" => Self::Oauth2,
"oauth" => Self::Oauth,
"api_key" => Self::ApiKey,
"oauth2_client_credentials" => Self::Oauth2ClientCredentials,
"keka_oauth" => Self::KekaOauth,
"jwt_bearer" => Self::JwtBearer,
"aws_sts" => Self::AwsSts,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegratedAccountCreateAuthenticationMethod {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegratedAccountCreateAuthenticationMethod {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegratedAccountCreateAuthenticationMethod {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegratedAccountCreateAuthenticationMethod {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegratedAccountCreateAuthenticationMethod {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " The region where the integrated account is placed."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegratedAccountCreateRegion {
#[doc = " `wnam`"]
Wnam,
#[doc = " `enam`"]
Enam,
#[doc = " `apac`"]
Apac,
#[doc = " `eu`"]
Eu,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegratedAccountCreateRegion {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Wnam => "wnam",
Self::Enam => "enam",
Self::Apac => "apac",
Self::Eu => "eu",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegratedAccountCreateRegion {
fn from(s: &str) -> Self {
match s {
"wnam" => Self::Wnam,
"enam" => Self::Enam,
"apac" => Self::Apac,
"eu" => Self::Eu,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegratedAccountCreateRegion {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegratedAccountCreateRegion {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegratedAccountCreateRegion {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegratedAccountCreateRegion {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegratedAccountCreateRegion {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountCredentialsUpdateRequest {
#[doc = " The credential fields to update in the integrated account context"]
pub context: Map<String, Value>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountFormTokenRequest {
#[doc = " The connection whose post-connect form should be reopened. Must belong to this session's tenant."]
pub integrated_account_id: String,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountFormTokenResponse {
#[doc = " The purpose-limited token. Keep it in memory; never put it in a URL."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integrated_account_token: Option<String>,
#[doc = " When the token stops working."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expires_at: Option<String>,
}
#[doc = " Details of the most recent `403 Forbidden` returned by the third-party API for this account, or `null` if the most recent call succeeded. Cleared automatically on the next successful call."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountLastForbiddenError {
#[doc = " The third-party resource that was forbidden."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource: Option<String>,
#[doc = " The method that was attempted on that resource."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub method: Option<String>,
#[doc = " The scopes required by this resource and method that the provider did not confirm as granted."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub missing_scopes: Option<Vec<String>>,
#[doc = " Which of the states below produced this record, so a reader never has to infer it from the presence or emptiness of `missing_scopes`. Absent on rows recorded before Truto stored it — and on such a row an empty `missing_scopes` cannot be read as \"compared, nothing missing\", because it was also written when nothing had been compared at all."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub refusal_basis: Option<String>,
#[doc = " The sentence the live 403 carried, recorded so this row reads the same as the call did."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[doc = " Scopes of which the operation needs *any one*, where the grant holds none. Kept apart from `missing_scopes` so alternatives are never reported as though all were required."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub missing_any_of_scopes: Option<Vec<String>>,
#[doc = " What this operation requires, whether or not a comparison was possible. Always paired with `permission_vocabulary`, since the same string means \"reconnect and grant this\", \"add this to your API key\" or \"ask an admin for this role\" depending on which vocabulary it is written in."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub required_permissions: Option<Vec<String>>,
#[doc = " Permissions of which the operation needs *any one*, kept apart from `required_permissions` for the same reason."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub required_any_of_permissions: Option<Vec<String>>,
#[doc = " Which vocabulary `required_permissions` is written in, and therefore what the remedy is. Only `oauth_scope` is fixed by reconnecting: `api_key_permission` is granted to the API key in the provider, and `role_label` in the provider's own admin console."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub permission_vocabulary: Option<String>,
#[doc = " A capped copy of the integration's own error body, so this record shows what the provider said and not only what Truto inferred about it. Truncated with a trailing `… truncated` marker past 2,048 **bytes** of UTF-8, because this record is deserialized on every proxy and unified call that resolves the account and that cost is what the bound exists to control. Bytes, not characters: 2,048 characters of CJK is about 6 KB stored, so a character bound would charge one language three times what it charges another. Expect fewer characters than 2,048 for any non-ASCII body. The 2,048 covers the marker as well, so the stored value never exceeds it."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub raw_response_excerpt: Option<String>,
#[doc = " When the forbidden response was recorded."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub occurred_at: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountMcpCreateRequest {
#[doc = " The name of the MCP server."]
pub name: String,
pub config: IntegratedAccountMcpCreateRequestConfig,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountMcpCreateRequestConfig {
#[doc = " The methods allowed for this server."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub methods: Option<Vec<String>>,
#[doc = " The tags associated with this server."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountMcpUpdateRequest {
#[doc = " The new name for the MCP server."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " Updated configuration settings for the MCP server"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<IntegratedAccountMcpUpdateRequestConfig>,
}
#[doc = " Updated configuration settings for the MCP server"]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountMcpUpdateRequestConfig {
#[doc = " The methods allowed for this server."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub methods: Option<Vec<String>>,
#[doc = " The tags associated with this server."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountRefreshCredentialsRequest {
#[doc = " The ID of the integrated account you want to refresh the credentials for."]
pub id: String,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountRefreshCredentialsResponse {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub success: Option<bool>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountRefreshMappingCacheRequest {
#[doc = " The environment whose cache to refresh. Optional when authenticating with an API token, which is already scoped to one environment — required otherwise."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[doc = " Restrict the per-connection clears to this integration's connections, and also drop its cached integration configuration. Must be an integration installed in this environment."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration_id: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountRefreshMappingCacheResponse {
#[doc = " The environment the refresh was applied to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[doc = " The integration the refresh was narrowed to, if any."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration_id: Option<String>,
#[doc = " How many shared cache entries were deleted."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub deleted_cache_key_count: Option<i64>,
#[doc = " True when the sweep did not finish — some shared entries are still cached and will expire on their own. Call again to continue."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cache_keys_truncated: Option<bool>,
#[doc = " How many of the environment's connections are having their per-connection cache cleared."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integrated_account_count: Option<i64>,
#[doc = " True when the environment has more connections than one refresh covers, so some keep their cached copy until it expires."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integrated_accounts_truncated: Option<bool>,
#[doc = " The same caveat in prose, safe to surface to a user."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
#[doc = " The region where the integrated account is placed."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegratedAccountRegion {
#[doc = " `wnam`"]
Wnam,
#[doc = " `enam`"]
Enam,
#[doc = " `apac`"]
Apac,
#[doc = " `eu`"]
Eu,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegratedAccountRegion {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Wnam => "wnam",
Self::Enam => "enam",
Self::Apac => "apac",
Self::Eu => "eu",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegratedAccountRegion {
fn from(s: &str) -> Self {
match s {
"wnam" => Self::Wnam,
"enam" => Self::Enam,
"apac" => Self::Apac,
"eu" => Self::Eu,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegratedAccountRegion {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegratedAccountRegion {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegratedAccountRegion {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegratedAccountRegion {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegratedAccountRegion {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountResponse {
#[doc = " The ID of the integrated account."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The ID of the tenant."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tenant_id: Option<String>,
#[doc = " The ID of the environment integration (installed integration)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_integration_id: Option<String>,
#[doc = " The context of the integrated account. You can find these in the `Variables` section of an integrated account in the Truto UI."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub context: Option<Map<String, Value>>,
#[doc = " Status of the integrated account."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status: Option<IntegratedAccountStatus>,
#[doc = " The last error that occurred while running the post install or validation steps."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_error: Option<String>,
#[doc = " Details of the most recent `403 Forbidden` returned by the third-party API for this account, or `null` if the most recent call succeeded. Cleared automatically on the next successful call."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_forbidden_error: Option<IntegratedAccountLastForbiddenError>,
#[doc = " The results of the post install and validation steps that ran on the integrated account."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_action_result: Option<Map<String, Value>>,
#[doc = " The date and time when the integrated account was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the integrated account was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
#[doc = " Whether the integrated account is in sandbox mode or not. Sandbox integrated accounts do not allow any \"write\" operations."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_sandbox: Option<bool>,
#[doc = " Type of authentication used."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authentication_method: Option<IntegratedAccountAuthenticationMethod>,
#[doc = " The region where the integrated account is placed."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub region: Option<IntegratedAccountRegion>,
#[doc = " The ID of the environment this integrated account belongs to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[doc = " The integration associated with this integrated account."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration: Option<IntegrationSchema>,
#[doc = " The list of context fields that are stored in the object store."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub object_store_context_fields: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountRunPostInstallActionsRequest {
#[doc = " The ID of the integrated account you want to the post install actions for."]
pub id: String,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountRunPostInstallActionsResponse {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub success: Option<bool>,
}
#[doc = " Status of the integrated account."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegratedAccountStatus {
#[doc = " `active`"]
Active,
#[doc = " `connecting`"]
Connecting,
#[doc = " `post_install_error`"]
PostInstallError,
#[doc = " `validation_error`"]
ValidationError,
#[doc = " `needs_reauth`"]
NeedsReauth,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegratedAccountStatus {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Active => "active",
Self::Connecting => "connecting",
Self::PostInstallError => "post_install_error",
Self::ValidationError => "validation_error",
Self::NeedsReauth => "needs_reauth",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegratedAccountStatus {
fn from(s: &str) -> Self {
match s {
"active" => Self::Active,
"connecting" => Self::Connecting,
"post_install_error" => Self::PostInstallError,
"validation_error" => Self::ValidationError,
"needs_reauth" => Self::NeedsReauth,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegratedAccountStatus {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegratedAccountStatus {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegratedAccountStatus {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegratedAccountStatus {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegratedAccountStatus {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountTokenRequest {
#[doc = " The ID of the integrated account you want to scope the token to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integrated_account_id: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountTokenResponse {
#[doc = " The integrated account token that can be used to make API calls."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integrated_account_token: Option<String>,
}
#[doc = " Per-account unified-mapping overrides, keyed by unified model name and then by resource name. Only the method keys `list`, `create`, `get`, `update` and `delete` are read, and each accepts the subset of mapping fields in `IntegratedAccountUnifiedModelOverrideMethod` — any other field is dropped on write."]
pub type IntegratedAccountUnifiedModelOverride = BTreeMap<String, BTreeMap<String, IntegratedAccountUnifiedModelOverrideValueValue>>;
#[doc = " The mapping fields an account-scoped override may set. Deliberately a subset of `UnifiedModelResourceMethod`: `path_mapping`, `error_mapping`, the header mappings, `is_partial_*`, `static` and `mapping_version` are **not** accepted here — set those on `environment-unified-model-resource-method` instead."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountUnifiedModelOverrideMethod {
#[doc = " Integration resource to call."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource: Option<Value>,
#[doc = " Integration method to call."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub method: Option<Value>,
#[doc = " JSONata expression (string) or object-form mapping."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response_mapping: Option<Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response_mapping_method: Option<IntegratedAccountUnifiedModelOverrideMethodResponseMappingMethod>,
#[doc = " Static query params merged into the integration request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query: Option<Map<String, Value>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query_schema: Option<Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query_mapping: Option<Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub request_body_mapping: Option<Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub request_body_schema: Option<BTreeMap<String, JsonSchemaObjectProperties>>,
#[doc = " Static body merged into the integration request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body: Option<Map<String, Value>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub file_upload: Option<Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub before: Option<Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub after: Option<Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub side_load: Option<BTreeMap<String, EnvironmentUnifiedModelSideLoad>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub related_resources: Option<Value>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegratedAccountUnifiedModelOverrideMethodResponseMappingMethod {
#[doc = " `array`"]
Array,
#[doc = " `item`"]
Item,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegratedAccountUnifiedModelOverrideMethodResponseMappingMethod {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Array => "array",
Self::Item => "item",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegratedAccountUnifiedModelOverrideMethodResponseMappingMethod {
fn from(s: &str) -> Self {
match s {
"array" => Self::Array,
"item" => Self::Item,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegratedAccountUnifiedModelOverrideMethodResponseMappingMethod {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegratedAccountUnifiedModelOverrideMethodResponseMappingMethod {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegratedAccountUnifiedModelOverrideMethodResponseMappingMethod {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegratedAccountUnifiedModelOverrideMethodResponseMappingMethod {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegratedAccountUnifiedModelOverrideMethodResponseMappingMethod {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountUnifiedModelOverrideValueValue {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub list: Option<IntegratedAccountUnifiedModelOverrideMethod>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub create: Option<IntegratedAccountUnifiedModelOverrideMethod>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub get: Option<IntegratedAccountUnifiedModelOverrideMethod>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub update: Option<IntegratedAccountUnifiedModelOverrideMethod>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub delete: Option<IntegratedAccountUnifiedModelOverrideMethod>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountUpdate {
#[doc = " The ID of the tenant."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tenant_id: Option<String>,
#[doc = " The context of the integrated account. You can find these in the `Variables` section of an integrated account in the Truto UI."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub context: Option<Map<String, Value>>,
#[doc = " Account-scoped unified-mapping overrides — the narrowest mapping scope there is. Deep-merged on top of the environment and base mappings for this one connected account only. Send `{}` to revert the account to the environment/base mappings."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub unified_model_override: Option<IntegratedAccountUnifiedModelOverride>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountValidateResponse {
#[doc = " Whether every step passed."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub success: Option<bool>,
#[doc = " One entry per step, in the order they ran."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub steps: Option<Vec<Map<String, Value>>>,
#[doc = " Present only when `success` is false. The failure that stopped the run, and the same value written to the account's `last_error`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[doc = " Internal representation of an inbound webhook event for an integrated account. The code: 1. Validates the request (signature, etc.) 2. Parses it into this payload structure 3. Maps it to a unified resource if appropriate."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegratedAccountWebhookPayload {
#[doc = " The parsed JSON body from the request."]
pub body: Map<String, Value>,
#[doc = " The raw text body as sent by the external service (pre-JSON parsing)."]
pub raw_body: String,
#[doc = " The inbound request headers."]
pub headers: BTreeMap<String, String>,
#[doc = " The inbound query parameters from the request URL, if any."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query_params: Option<BTreeMap<String, String>>,
#[doc = " ID of the integrated account receiving the webhook."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integrated_account_id: Option<String>,
#[doc = " The environment in which this integrated account resides."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[doc = " Key/value context fields stored within the integrated account."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub context: Option<Map<String, Value>>,
#[doc = " Optional environment integration ID associated with the integrated account."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_integration_id: Option<String>,
#[doc = " The type of this webhook payload, if relevant (e.g. a \"verify\" event)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub webhook_type: Option<IntegratedAccountWebhookPayloadWebhookType>,
}
#[doc = " The type of this webhook payload, if relevant (e.g. a \"verify\" event)."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegratedAccountWebhookPayloadWebhookType {
#[doc = " `verify`"]
Verify,
#[doc = " `payload`"]
Payload,
#[doc = " `meta`"]
Meta,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegratedAccountWebhookPayloadWebhookType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Verify => "verify",
Self::Payload => "payload",
Self::Meta => "meta",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegratedAccountWebhookPayloadWebhookType {
fn from(s: &str) -> Self {
match s {
"verify" => Self::Verify,
"payload" => Self::Payload,
"meta" => Self::Meta,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegratedAccountWebhookPayloadWebhookType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegratedAccountWebhookPayloadWebhookType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegratedAccountWebhookPayloadWebhookType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegratedAccountWebhookPayloadWebhookType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegratedAccountWebhookPayloadWebhookType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " A named integration action. Built-in actions are `post_install`, `post_connect_user_form`, `refresh_token`, and `validation`; arbitrary names are also allowed for custom flows triggered via the proxy or sync runtime."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationAction {
#[doc = " Ordered list of steps to run when the action is invoked."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub steps: Option<Vec<IntegrationActionStep>>,
#[doc = " Optional action type tag (e.g. `request` for single-shot actions). When omitted, `steps` is used."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#type: Option<String>,
#[doc = " Optional top-level config used when `type` is set instead of `steps`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<Map<String, Value>>,
}
#[doc = " A single step in an integration `action` (post-install hook, validation hook, refresh-token override, custom flows). Steps run sequentially with a shared `context`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationActionStep {
#[doc = " Step kind: * `request` — perform an HTTP call (config matches `IntegrationResourceMethod`). * `transform` — apply a JSONata expression over the running context. * `update_context` / `set_context` — write into the shared step context. * `get_context` — read from the shared step context. * `form` — pause and ask the connected user to fill a form (post-connect form)."]
pub r#type: IntegrationActionStepType,
#[doc = " Step-specific configuration. For `request`, accepts the same shape as `IntegrationResourceMethod`. For `transform`, a JSONata expression string. For `form`, a fields array."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<Value>,
}
#[doc = " Step kind: * `request` — perform an HTTP call (config matches `IntegrationResourceMethod`). * `transform` — apply a JSONata expression over the running context. * `update_context` / `set_context` — write into the shared step context. * `get_context` — read from the shared step context. * `form` — pause and ask the connected user to fill a form (post-connect form)."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationActionStepType {
#[doc = " `request`"]
Request,
#[doc = " `transform`"]
Transform,
#[doc = " `update_context`"]
UpdateContext,
#[doc = " `get_context`"]
GetContext,
#[doc = " `set_context`"]
SetContext,
#[doc = " `form`"]
Form,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationActionStepType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Request => "request",
Self::Transform => "transform",
Self::UpdateContext => "update_context",
Self::GetContext => "get_context",
Self::SetContext => "set_context",
Self::Form => "form",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationActionStepType {
fn from(s: &str) -> Self {
match s {
"request" => Self::Request,
"transform" => Self::Transform,
"update_context" => Self::UpdateContext,
"get_context" => Self::GetContext,
"set_context" => Self::SetContext,
"form" => Self::Form,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationActionStepType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationActionStepType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationActionStepType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationActionStepType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationActionStepType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " API-key based credential. Customer pastes one or more secret values that are stored verbatim and templated into request headers/queries."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationApiKeyCredential {
pub format: IntegrationApiKeyCredentialFormat,
pub config: IntegrationApiKeyCredentialConfig,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationApiKeyCredentialConfig {
#[doc = " Custom label for this authentication method shown in the Connect UI."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
#[doc = " Short description shown below the label in the Connect UI when choosing between authentication methods."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub help_text: Option<String>,
#[doc = " URL to vendor documentation that helps the customer find their API key."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub documentation_link: Option<String>,
#[doc = " Plain-text description of what permissions the API key needs."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub permissions_text: Option<String>,
#[doc = " Fields collected from the customer in the Connect UI."]
pub fields: Vec<IntegrationField>,
#[doc = " Values Truto generates once per connection and stores in the integrated-account context under each entry's `name`. Declared instead of a `fields` entry when the provider requires the value to be generated by Truto rather than supplied by the customer — AWS's External ID is the first. A caller-supplied value for one of these names is ignored, and an existing value is never regenerated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub generated_fields: Option<Vec<IntegrationGeneratedField>>,
#[doc = " Optional list of scope strings recorded against the credential (informational only for `api_key`)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scope: Option<Vec<String>>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationApiKeyCredentialFormat {
#[doc = " `api_key`"]
ApiKey,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationApiKeyCredentialFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::ApiKey => "api_key",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationApiKeyCredentialFormat {
fn from(s: &str) -> Self {
match s {
"api_key" => Self::ApiKey,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationApiKeyCredentialFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationApiKeyCredentialFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationApiKeyCredentialFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationApiKeyCredentialFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationApiKeyCredentialFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " How Truto applies the resolved credential to outbound HTTP requests. The `format` discriminator selects which `config` shape applies."]
///
/// Union type: holds the raw JSON and decodes a variant on demand.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(transparent)]
pub struct IntegrationAuthorization(pub Value);
impl IntegrationAuthorization {
/// The raw JSON value.
pub fn raw(&self) -> &Value {
&self.0
}
/// Consume the wrapper and return the raw JSON value.
pub fn into_raw(self) -> Value {
self.0
}
/// Decode the value as [`IntegrationBearerAuthorization`].
pub fn as_integration_bearer_authorization(&self) -> Result<IntegrationBearerAuthorization, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`IntegrationBasicAuthorization`].
pub fn as_integration_basic_authorization(&self) -> Result<IntegrationBasicAuthorization, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`IntegrationHeaderAuthorization`].
pub fn as_integration_header_authorization(&self) -> Result<IntegrationHeaderAuthorization, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
}
impl From<IntegrationBearerAuthorization> for IntegrationAuthorization {
fn from(v: IntegrationBearerAuthorization) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<IntegrationBasicAuthorization> for IntegrationAuthorization {
fn from(v: IntegrationBasicAuthorization) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<IntegrationHeaderAuthorization> for IntegrationAuthorization {
fn from(v: IntegrationHeaderAuthorization) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<Value> for IntegrationAuthorization {
fn from(v: Value) -> Self {
Self(v)
}
}
#[doc = " AWS STS credential exchange. A long-lived AWS key signs one `AssumeRole` call and AWS returns a short-lived key belonging to whichever account owns the role."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationAwsStsCredential {
pub format: IntegrationAwsStsCredentialFormat,
pub config: IntegrationAwsStsCredentialConfig,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationAwsStsCredentialConfig {
#[doc = " Custom label for this authentication method shown in the Connect UI."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
#[doc = " Short description shown below the label in the Connect UI when choosing between authentication methods."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub help_text: Option<String>,
#[doc = " The IAM key that signs the `AssumeRole` call — a bring-your-own-credential pair on the same footing as an OAuth app's `client.id` / `client.secret`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub signing: Option<IntegrationAwsStsCredentialConfigSigning>,
#[doc = " The role to assume. Every field supports `{{...}}` placeholders, plus `{{token_key}}`, which is bound to the resolved token key."]
pub role: IntegrationAwsStsCredentialConfigRole,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub auth: Option<IntegrationAwsStsCredentialConfigAuth>,
#[doc = " Which cached credential slot this request uses, as a template resolved against the request context — for example `{{query.truto_account_id}}`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub token_key: Option<String>,
#[doc = " The CloudFormation template (an S3 `.yaml` / `.yml` object) the connect form's grant link launches. Not a secret. Available to the connect form and the post-connect form as `{{template_url}}` and, percent-encoded for use inside a URL, `{{template_url_encoded}}`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub template_url: Option<String>,
#[doc = " The 12-digit AWS account the template grants access to — the account that owns the signing key. Not a secret. Available to the connect form and the post-connect form as `{{provider_account_id}}`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub provider_account_id: Option<String>,
pub fields: Vec<IntegrationField>,
#[doc = " Values Truto generates once per connection and stores in the integrated-account context under each entry's `name`. Declared instead of a `fields` entry when the provider requires the value to be generated by Truto rather than supplied by the customer — AWS's External ID is the first. A caller-supplied value for one of these names is ignored, and an existing value is never regenerated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub generated_fields: Option<Vec<IntegrationGeneratedField>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub documentation_link: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub permissions_text: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationAwsStsCredentialConfigAuth {
#[doc = " Defaults to `https://sts.amazonaws.com`."]
#[serde(rename = "tokenHost")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub token_host: Option<String>,
#[doc = " Region the exchange is signed for. Defaults to `us-east-1`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub region: Option<String>,
}
#[doc = " The role to assume. Every field supports `{{...}}` placeholders, plus `{{token_key}}`, which is bound to the resolved token key."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationAwsStsCredentialConfigRole {
#[doc = " Role ARN, e.g. `arn:aws:iam::{{token_key}}:role/TrutoCloudRead`."]
pub arn: String,
#[doc = " `RoleSessionName`. Sanitised to `[\\w+=,.@-]{2,64}`, which is all AWS accepts. Defaults to `truto`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub session_name: Option<String>,
#[doc = " `ExternalId`, when the role's trust policy requires one."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub external_id: Option<String>,
#[doc = " `DurationSeconds`. Capped by the role's own `MaxSessionDuration`. Defaults to 3600."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub duration_seconds: Option<Value>,
}
#[doc = " The IAM key that signs the `AssumeRole` call — a bring-your-own-credential pair on the same footing as an OAuth app's `client.id` / `client.secret`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationAwsStsCredentialConfigSigning {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub access_key_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub secret_access_key: Option<String>,
#[doc = " Only needed when the signing key is itself temporary."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub session_token: Option<String>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationAwsStsCredentialFormat {
#[doc = " `aws_sts`"]
AwsSts,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationAwsStsCredentialFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::AwsSts => "aws_sts",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationAwsStsCredentialFormat {
fn from(s: &str) -> Self {
match s {
"aws_sts" => Self::AwsSts,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationAwsStsCredentialFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationAwsStsCredentialFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationAwsStsCredentialFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationAwsStsCredentialFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationAwsStsCredentialFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Adds an HTTP Basic `Authorization: Basic base64(username:password)` header."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationBasicAuthorization {
pub format: IntegrationBasicAuthorizationFormat,
pub config: IntegrationBasicAuthorizationConfig,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationBasicAuthorizationConfig {
#[doc = " Username, supports placeholders (e.g. `{{api_key}}` for vendors that pass the API key as the username)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub username: Option<String>,
#[doc = " Password, supports placeholders."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub password: Option<String>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationBasicAuthorizationFormat {
#[doc = " `basic`"]
Basic,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationBasicAuthorizationFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Basic => "basic",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationBasicAuthorizationFormat {
fn from(s: &str) -> Self {
match s {
"basic" => Self::Basic,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationBasicAuthorizationFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationBasicAuthorizationFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationBasicAuthorizationFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationBasicAuthorizationFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationBasicAuthorizationFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Adds `Authorization: Bearer <value>` to every request."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationBearerAuthorization {
pub format: IntegrationBearerAuthorizationFormat,
pub config: IntegrationBearerAuthorizationConfig,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationBearerAuthorizationConfig {
#[doc = " The bearer token. Almost always a placeholder like `{{oauth.token.access_token}}` (OAuth2) or `{{api_key}}` (api-key fields)."]
pub value: String,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationBearerAuthorizationFormat {
#[doc = " `bearer`"]
Bearer,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationBearerAuthorizationFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Bearer => "bearer",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationBearerAuthorizationFormat {
fn from(s: &str) -> Self {
match s {
"bearer" => Self::Bearer,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationBearerAuthorizationFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationBearerAuthorizationFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationBearerAuthorizationFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationBearerAuthorizationFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationBearerAuthorizationFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Complete integration configuration. Validated by Truto on `POST /integration` and `PATCH /integration/{id}`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationConfig {
#[doc = " Default base URL prepended to every resource method's `path`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub base_url: Option<String>,
#[doc = " Human-readable name shown in the Truto Dashboard and Link UI."]
pub label: String,
#[doc = " URL to the integration logo (square, recommended 256x256)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub logo: Option<String>,
#[doc = " URL to a smaller monochrome icon used in catalog listings."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub icon: Option<String>,
#[doc = " Default HTTP headers merged into every outbound request. Values may be templated with JSONata placeholders."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub headers: Option<BTreeMap<String, Option<String>>>,
#[doc = " Default query-string params merged into every outbound request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query: Option<BTreeMap<String, String>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query_array_format: Option<IntegrationConfigQueryArrayFormat>,
#[doc = " Named integration actions. Reserved keys (`post_install`, `post_connect_user_form`, `refresh_token`, `validation`) hook into specific platform lifecycle events; custom names are callable from the proxy/sync runtime."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub actions: Option<BTreeMap<String, IntegrationAction>>,
#[doc = " Either a single credential definition (when the integration only supports one auth format) or a map keyed by auth format (when an integration supports multiple, e.g. `api_key` and `oauth2`). For multi-format integrations, the customer picks one in the Connect UI. Each credential's `config.label` and `config.help_text` customize the auth-method card shown in the Connect UI."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub credentials: Option<Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authorization: Option<IntegrationAuthorization>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pagination: Option<IntegrationPagination>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub rate_limit: Option<IntegrationRateLimit>,
#[doc = " Resource → method tree (e.g. `resources.users.list`). The inner key is one of the canonical methods (`list`, `get`, `create`, `update`, `delete`) or a custom method name. Each method definition matches `IntegrationResourceMethod`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resources: Option<BTreeMap<String, BTreeMap<String, IntegrationResourceMethod>>>,
#[doc = " Optional tag arrays keyed by resource name (`contacts`) or `resource.method` (`contacts.delete`). Method-level tags are unioned with resource-level tags when building MCP tools and filtering by MCP token `config.tags`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tool_tags: Option<BTreeMap<String, Vec<String>>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub webhook: Option<IntegrationWebhookConfig>,
#[doc = " Integration-wide JSONata expression evaluated on every response. Use to detect errors in successful (2xx) responses, normalize error messages, or transform \"errors\" with `< 400` status into successful responses. Overridden by per-method `IntegrationResourceMethod.error_expression` when set."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error_expression: Option<String>,
#[doc = " This provider's **browser** file picker cannot run without the connected account's upstream `access_token`, so `GET /integrated-account/me` releases `context.oauth.token.access_token` — and nothing else — to a connect-flow integrated account token. Google Drive and Box need it; their picker SDKs take the token client-side. SharePoint, OneDrive and Dropbox authenticate by other means and must leave this unset."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub browser_file_picker_requires_access_token: Option<bool>,
#[doc = " Headers built from the connected account's OAuth app and sent on every request, for providers that want the app's own key next to the user's token. Etsy, for example, needs `{ \"x-api-key\": \"{{client.id}}:{{client.secret}}\" }`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub oauth_app_headers: Option<BTreeMap<String, String>>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationConfigQueryArrayFormat {
#[doc = " `comma`"]
Comma,
#[doc = " `brackets`"]
Brackets,
#[doc = " `indices`"]
Indices,
#[doc = " `repeat`"]
Repeat,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationConfigQueryArrayFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Comma => "comma",
Self::Brackets => "brackets",
Self::Indices => "indices",
Self::Repeat => "repeat",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationConfigQueryArrayFormat {
fn from(s: &str) -> Self {
match s {
"comma" => Self::Comma,
"brackets" => Self::Brackets,
"indices" => Self::Indices,
"repeat" => Self::Repeat,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationConfigQueryArrayFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationConfigQueryArrayFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationConfigQueryArrayFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationConfigQueryArrayFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationConfigQueryArrayFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationCreateRequest {
#[doc = " The name of your integration."]
pub name: String,
#[doc = " A short descriptor or category."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub category: Option<String>,
#[doc = " The core configuration object for the integration. See `IntegrationConfig` for the full typed shape (credentials, resources, pagination, webhook, etc.)."]
pub config: IntegrationConfig,
#[doc = " Whether the integration is considered beta."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_beta: Option<bool>,
}
#[doc = " A single integration credential definition. The `format` discriminator selects which credential shape applies."]
///
/// Union type: holds the raw JSON and decodes a variant on demand.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(transparent)]
pub struct IntegrationCredential(pub Value);
impl IntegrationCredential {
/// The raw JSON value.
pub fn raw(&self) -> &Value {
&self.0
}
/// Consume the wrapper and return the raw JSON value.
pub fn into_raw(self) -> Value {
self.0
}
/// Decode the value as [`IntegrationApiKeyCredential`].
pub fn as_integration_api_key_credential(&self) -> Result<IntegrationApiKeyCredential, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`IntegrationOAuth2Credential`].
pub fn as_integration_o_auth2_credential(&self) -> Result<IntegrationOAuth2Credential, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`IntegrationOAuthCredential`].
pub fn as_integration_o_auth_credential(&self) -> Result<IntegrationOAuthCredential, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`IntegrationKekaOAuthCredential`].
pub fn as_integration_keka_o_auth_credential(&self) -> Result<IntegrationKekaOAuthCredential, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`IntegrationOAuth2ClientCredential`].
pub fn as_integration_o_auth2_client_credential(&self) -> Result<IntegrationOAuth2ClientCredential, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`IntegrationJwtBearerCredential`].
pub fn as_integration_jwt_bearer_credential(&self) -> Result<IntegrationJwtBearerCredential, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`IntegrationAwsStsCredential`].
pub fn as_integration_aws_sts_credential(&self) -> Result<IntegrationAwsStsCredential, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
}
impl From<IntegrationApiKeyCredential> for IntegrationCredential {
fn from(v: IntegrationApiKeyCredential) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<IntegrationOAuth2Credential> for IntegrationCredential {
fn from(v: IntegrationOAuth2Credential) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<IntegrationOAuthCredential> for IntegrationCredential {
fn from(v: IntegrationOAuthCredential) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<IntegrationKekaOAuthCredential> for IntegrationCredential {
fn from(v: IntegrationKekaOAuthCredential) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<IntegrationOAuth2ClientCredential> for IntegrationCredential {
fn from(v: IntegrationOAuth2ClientCredential) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<IntegrationJwtBearerCredential> for IntegrationCredential {
fn from(v: IntegrationJwtBearerCredential) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<IntegrationAwsStsCredential> for IntegrationCredential {
fn from(v: IntegrationAwsStsCredential) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<Value> for IntegrationCredential {
fn from(v: Value) -> Self {
Self(v)
}
}
#[doc = " Cursor-based pagination, where the next cursor is read from a path inside the response body or headers."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationCursorPagination {
pub format: IntegrationCursorPaginationFormat,
#[doc = " Cursor pagination options."]
pub config: IntegrationCursorPaginationConfig,
}
#[doc = " Cursor pagination options."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationCursorPaginationConfig {
#[doc = " Dotted-path accessor into the response body (or headers, when `cursor_path_object: header`) that yields the next cursor."]
pub cursor_path: String,
#[doc = " Optional accessor that yields the previous-page cursor."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub prev_cursor_path: Option<String>,
#[doc = " Query/body key Truto uses to send the cursor on the next request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor_key: Option<String>,
#[doc = " Optional accessor that returns a truthy/`\"true\"`/`\"false\"` value indicating whether more pages exist."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub has_next_path: Option<String>,
#[doc = " Query/body key that holds the page size."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub limit_key: Option<String>,
#[doc = " Maximum page size Truto will request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub max_limit: Option<i64>,
#[doc = " Treat the value at `cursor_path` as a fully-qualified URL (or path) rather than an opaque token."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_link: Option<bool>,
#[doc = " When `is_link` is true, also overwrite the request path with the link's path (not just the query string)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub include_path: Option<bool>,
#[doc = " Static or templated headers added to every paginated request. Templated against the request `query` plus a synthetic `limit`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub headers: Option<BTreeMap<String, String>>,
#[doc = " Send the cursor in the request body instead of the URL."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub add_to_body: Option<bool>,
#[doc = " Cast the limit value when sending it in the body."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub limit_data_type: Option<IntegrationCursorPaginationConfigLimitDataType>,
#[doc = " Don't re-send `limit_key` after the first page (for APIs that reject it on subsequent calls)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ignore_limit_in_pagination: Option<bool>,
#[doc = " Where to read `cursor_path` from."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor_path_object: Option<IntegrationCursorPaginationConfigCursorPathObject>,
#[doc = " Detect loops by hashing each page's results. Only effective when `cursor_path_object` is `body`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub use_content_hash: Option<bool>,
#[doc = " Add the cursor to the query string."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub add_to_query: Option<bool>,
#[doc = " URL-decode the cursor before sending (some upstreams double-encode)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_cursor_url_encoded: Option<bool>,
#[doc = " Don't treat an empty cursor as the end of pagination."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub allow_empty_page_cursor: Option<bool>,
}
#[doc = " Where to read `cursor_path` from."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationCursorPaginationConfigCursorPathObject {
#[doc = " `body`"]
Body,
#[doc = " `header`"]
Header,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationCursorPaginationConfigCursorPathObject {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Body => "body",
Self::Header => "header",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationCursorPaginationConfigCursorPathObject {
fn from(s: &str) -> Self {
match s {
"body" => Self::Body,
"header" => Self::Header,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationCursorPaginationConfigCursorPathObject {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationCursorPaginationConfigCursorPathObject {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationCursorPaginationConfigCursorPathObject {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationCursorPaginationConfigCursorPathObject {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationCursorPaginationConfigCursorPathObject {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Cast the limit value when sending it in the body."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationCursorPaginationConfigLimitDataType {
#[doc = " `number`"]
Number,
#[doc = " `string`"]
String,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationCursorPaginationConfigLimitDataType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Number => "number",
Self::String => "string",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationCursorPaginationConfigLimitDataType {
fn from(s: &str) -> Self {
match s {
"number" => Self::Number,
"string" => Self::String,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationCursorPaginationConfigLimitDataType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationCursorPaginationConfigLimitDataType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationCursorPaginationConfigLimitDataType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationCursorPaginationConfigLimitDataType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationCursorPaginationConfigLimitDataType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationCursorPaginationFormat {
#[doc = " `cursor`"]
Cursor,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationCursorPaginationFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Cursor => "cursor",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationCursorPaginationFormat {
fn from(s: &str) -> Self {
match s {
"cursor" => Self::Cursor,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationCursorPaginationFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationCursorPaginationFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationCursorPaginationFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationCursorPaginationFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationCursorPaginationFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Dynamic pagination driven entirely by JSONata expressions. Use this when none of the canonical strategies fit (e.g. SOAP-style request envelopes, HATEOAS links inside body fields, multi-step resumption tokens)."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationDynamicPagination {
pub format: IntegrationDynamicPaginationFormat,
pub config: IntegrationDynamicPaginationConfig,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationDynamicPaginationConfig {
#[doc = " Optional JSONata expression evaluated **before** the first request. Use to seed pagination values (e.g. compute a default `since` window)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub get_initial_pagination_values_expression: Option<String>,
#[doc = " JSONata expression evaluated **before each subsequent request** (when `query.next_cursor` is set). Mutates the URL/body/headers/query for the next page."]
pub get_pagination_values_expression: String,
#[doc = " JSONata expression evaluated **after each response**. Returns the next cursor (Truto then base64-encodes it) and optional loop-detection flags."]
pub get_cursor_from_response_expression: String,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationDynamicPaginationFormat {
#[doc = " `dynamic`"]
Dynamic,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationDynamicPaginationFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Dynamic => "dynamic",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationDynamicPaginationFormat {
fn from(s: &str) -> Self {
match s {
"dynamic" => Self::Dynamic,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationDynamicPaginationFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationDynamicPaginationFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationDynamicPaginationFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationDynamicPaginationFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationDynamicPaginationFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Input for `pagination.config.get_initial_pagination_values_expression` and `get_pagination_values_expression`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationDynamicPaginationRequestContext {
#[doc = " Current request URL."]
pub url: String,
#[doc = " Caller-supplied query params (with `next_cursor` already base64-decoded on subsequent pages)."]
pub query: BTreeMap<String, String>,
#[doc = " Current [Fetch `RequestInit`](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit) (headers, body, method, etc.). Treat as opaque unless you need to inject vendor-specific options."]
#[serde(rename = "requestOptions")]
pub request_options: Map<String, Value>,
}
#[doc = " Return value from `pagination.config.get_initial_pagination_values_expression` / `get_pagination_values_expression`. All fields are optional; only what you return is applied."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationDynamicPaginationRequestResult {
#[doc = " Replacement request URL for the next page."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
#[doc = " Query params to merge onto the URL (overwrites existing keys)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query: Option<BTreeMap<String, String>>,
#[doc = " Replacement request body for the next page."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body: Option<Map<String, Value>>,
#[doc = " Patch to deep-merge into the current [Fetch `RequestInit`](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit). Useful for adding pagination-specific headers."]
#[serde(rename = "requestOptions")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub request_options: Option<Map<String, Value>>,
#[doc = " Free-form bag of values Truto echoes back to subsequent expressions (for multi-step cursors that need to remember intermediate state)."]
#[serde(rename = "paginationValues")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pagination_values: Option<BTreeMap<String, String>>,
}
#[doc = " Input for `pagination.config.get_cursor_from_response_expression`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationDynamicPaginationResponseContext {
#[doc = " Final request URL that produced this response."]
pub url: String,
#[doc = " Raw [Fetch `Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) object. Headers and status are accessible here when you need to read pagination metadata from headers (e.g. `response.headers`)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response: Option<Map<String, Value>>,
#[doc = " Parsed response body (object or array). Truto skips the expression if the body isn't an object/array."]
pub body: Value,
#[doc = " Caller-supplied query params for this request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query: Option<BTreeMap<String, String>>,
#[doc = " `paginationValues` echoed from the most recent `get_pagination_values_expression` invocation."]
#[serde(rename = "paginationValues")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pagination_values: Option<BTreeMap<String, String>>,
}
#[doc = " Return value from `pagination.config.get_cursor_from_response_expression`. Truto base64-encodes `nextCursor` and `prevCursor` before storing them on the synthetic `query.next_cursor` for the next page."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationDynamicPaginationResponseResult {
#[doc = " Cursor for the next page. Return `null` to signal \"no more pages\"."]
#[serde(rename = "nextCursor")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub next_cursor: Option<String>,
#[doc = " Optional cursor for the previous page (for two-way paginators)."]
#[serde(rename = "prevCursor")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub prev_cursor: Option<String>,
#[doc = " Set to `true` if the response is identical to the previous one and Truto should stop paginating to avoid an infinite loop."]
#[serde(rename = "isLooping")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_looping: Option<bool>,
}
#[doc = " Input passed to every `error_expression` JSONata expression."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationErrorExpressionContext {
#[doc = " HTTP status code of the upstream response."]
pub status: i64,
#[doc = " Lower-cased response headers from the upstream call."]
pub headers: BTreeMap<String, String>,
#[doc = " Parsed response body. If the body is a plain object with a top-level `data` field, that field is used directly; otherwise the whole parsed body is provided."]
pub data: Value,
#[doc = " Raw [Fetch `Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) object. Prefer `headers`, `status`, and `data`; this is exposed for advanced inspection only."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response: Option<Map<String, Value>>,
}
#[doc = " Return value from an `error_expression`. Return `null` (or omit) to indicate \"no error\". Returning an object short-circuits with that error shape. When `status < 400`, the `result` field is bubbled up as a successful response (useful for vendors that signal \"no data\" via 200 with an error body)."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationErrorExpressionResult {
#[doc = " HTTP-style status code that Truto should report (e.g. `429`, `404`, `503`). Use `< 400` to convert an upstream \"error\" into a successful response."]
pub status: i64,
#[doc = " Human-readable error message attached to the resulting Truto error."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[doc = " Optional headers to attach to the resulting error/response."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub headers: Option<BTreeMap<String, Option<String>>>,
#[doc = " Optional structured metadata propagated to the dashboard error log and webhook payloads."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub metadata: Option<Map<String, Value>>,
#[doc = " Optional payload returned in lieu of the upstream response when `status < 400` (e.g. when the upstream returns 200 with an error envelope, you can normalize the shape here)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub result: Option<Value>,
}
#[doc = " A single user-facing field rendered in the Truto Link SDK during account connection. Used inside an integration credential's `config.fields` array to collect API keys, subdomains, OAuth client IDs, etc."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationField {
#[doc = " Stable identifier under which the user-supplied value is stored at the **top level** of the integrated-account context. Referenced from placeholders as `{{<name>}}` (e.g. a field named `subdomain` is read as `{{subdomain}}`)."]
pub name: String,
#[doc = " Human-readable label displayed next to the field in the Link UI."]
pub label: String,
#[doc = " How the field is rendered in the Link UI."]
pub r#type: IntegrationFieldType,
#[doc = " Optional default value pre-filled in the Link UI."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub default: Option<String>,
#[doc = " Whether the user must provide a value before connecting."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub required: Option<bool>,
#[doc = " Optional client-side validation hint. Either one of the well-known formats (`email`, `number`, `uuid`, `url`) or a custom regex name."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub format: Option<String>,
#[doc = " Optional transform applied to the user input before storing."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub transform: Option<IntegrationFieldTransform>,
#[doc = " Placeholder text shown in the input."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub placeholder: Option<String>,
#[doc = " Help text shown below the input."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub help_text: Option<String>,
#[doc = " Regex pattern used for client-side validation."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pattern: Option<String>,
#[doc = " Options for `single_select` fields."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub options: Option<Vec<IntegrationFieldOptionsItem>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationFieldOptionsItem {
pub label: String,
pub value: String,
}
#[doc = " Optional transform applied to the user input before storing."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationFieldTransform {
#[doc = " `lowercase`"]
Lowercase,
#[doc = " `uppercase`"]
Uppercase,
#[doc = " `sha256`"]
Sha256,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationFieldTransform {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Lowercase => "lowercase",
Self::Uppercase => "uppercase",
Self::Sha256 => "sha256",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationFieldTransform {
fn from(s: &str) -> Self {
match s {
"lowercase" => Self::Lowercase,
"uppercase" => Self::Uppercase,
"sha256" => Self::Sha256,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationFieldTransform {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationFieldTransform {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationFieldTransform {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationFieldTransform {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationFieldTransform {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " How the field is rendered in the Link UI."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationFieldType {
#[doc = " `text`"]
Text,
#[doc = " `password`"]
Password,
#[doc = " `single_select`"]
SingleSelect,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationFieldType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Text => "text",
Self::Password => "password",
Self::SingleSelect => "single_select",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationFieldType {
fn from(s: &str) -> Self {
match s {
"text" => Self::Text,
"password" => Self::Password,
"single_select" => Self::SingleSelect,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationFieldType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationFieldType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationFieldType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationFieldType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationFieldType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " A single value Truto generates once per connection, declared in a credential's `config.generated_fields` array. Used where the provider requires the value to be produced by Truto rather than by the customer. It is generated for the connection and kept for its life — a reconnect never regenerates it, and a caller-supplied value for the same name is ignored."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationGeneratedField {
#[doc = " Stable identifier under which the generated value is stored at the **top level** of the integrated-account context. Must not collide with a `config.fields` name."]
pub name: String,
#[doc = " What is generated."]
pub r#type: IntegrationGeneratedFieldType,
#[doc = " `uuid` only. Optional literal prefix prepended to the generated value."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub prefix: Option<String>,
#[doc = " `rsa_key_pair` only. Key size in bits."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub modulus_length: Option<i64>,
}
#[doc = " What is generated."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationGeneratedFieldType {
#[doc = " `uuid`"]
Uuid,
#[doc = " `rsa_key_pair`"]
RsaKeyPair,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationGeneratedFieldType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Uuid => "uuid",
Self::RsaKeyPair => "rsa_key_pair",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationGeneratedFieldType {
fn from(s: &str) -> Self {
match s {
"uuid" => Self::Uuid,
"rsa_key_pair" => Self::RsaKeyPair,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationGeneratedFieldType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationGeneratedFieldType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationGeneratedFieldType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationGeneratedFieldType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationGeneratedFieldType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Adds arbitrary headers to every request. Provide either `headers` (static map) or `expression` (JSONata returning the request to send), but not both."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationHeaderAuthorization {
pub format: IntegrationHeaderAuthorizationFormat,
pub config: IntegrationHeaderAuthorizationConfig,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationHeaderAuthorizationConfig {
#[doc = " Map of header name → value. Values support placeholders (e.g. `{ \"X-API-Key\": \"{{api_key}}\" }`)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub headers: Option<BTreeMap<String, String>>,
#[doc = " JSONata expression that fully constructs the outgoing request. Use for advanced cases (request signing, dynamic URL rewrites)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expression: Option<String>,
}
#[doc = " Input for `authorization.config.expression` (only used when `authorization.format` is `header` and the integration needs custom URL/body manipulation alongside the auth header)."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationHeaderAuthorizationContext {
#[doc = " Current outbound request URL."]
pub url: String,
#[doc = " Current [Fetch `RequestInit`](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit) (headers/body/method)."]
#[serde(rename = "requestOptions")]
pub request_options: Map<String, Value>,
#[doc = " Same request context used for placeholder resolution — credentials, OAuth tokens, env vars, etc."]
pub context: IntegrationPlaceholderContext,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationHeaderAuthorizationFormat {
#[doc = " `header`"]
Header,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationHeaderAuthorizationFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Header => "header",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationHeaderAuthorizationFormat {
fn from(s: &str) -> Self {
match s {
"header" => Self::Header,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationHeaderAuthorizationFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationHeaderAuthorizationFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationHeaderAuthorizationFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationHeaderAuthorizationFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationHeaderAuthorizationFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Return value from `authorization.config.expression`. Both `url` and `requestOptions` are required; Truto throws \"Invalid result from custom header jsonata expression\" when either is missing."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationHeaderAuthorizationResult {
#[doc = " New request URL (string or URL object)."]
pub url: Value,
#[doc = " New [Fetch `RequestInit`](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit) (must include any auth headers you want to send)."]
#[serde(rename = "requestOptions")]
pub request_options: Map<String, Value>,
}
#[doc = " JWT bearer assertion credential. Sign a JWT with a private key (or HMAC secret) and exchange it for an access token. Used for GitHub Apps, Google service accounts, Snowflake, and similar flows."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationJwtBearerCredential {
pub format: IntegrationJwtBearerCredentialFormat,
pub config: IntegrationJwtBearerCredentialConfig,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationJwtBearerCredentialConfig {
#[doc = " Custom label for this authentication method shown in the Connect UI."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
#[doc = " Short description shown below the label in the Connect UI when choosing between authentication methods."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub help_text: Option<String>,
#[doc = " App/service identity and signing material (not OAuth `client_id` / `client_secret`). Set `key`, or `generated` to sign with a key pair Truto made for the connection; when `generated` is set, `key` is ignored."]
pub signing: IntegrationJwtBearerCredentialConfigSigning,
pub jwt: IntegrationJwtBearerCredentialConfigJwt,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub auth: Option<IntegrationJwtBearerCredentialConfigAuth>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub options: Option<IntegrationJwtBearerCredentialConfigOptions>,
#[serde(rename = "tokenParams")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub token_params: Option<Map<String, Value>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub params: Option<BTreeMap<String, String>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub headers: Option<BTreeMap<String, Option<String>>>,
pub fields: Vec<IntegrationField>,
#[doc = " Values Truto generates once per connection and stores in the integrated-account context under each entry's `name`. Declared instead of a `fields` entry when the provider requires the value to be generated by Truto rather than supplied by the customer — AWS's External ID is the first. A caller-supplied value for one of these names is ignored, and an existing value is never regenerated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub generated_fields: Option<Vec<IntegrationGeneratedField>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub documentation_link: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub permissions_text: Option<String>,
#[doc = " Refuse a connection that carries no `truto_static_gate_id` — on connect, on `POST /integrated-account`, and on a `PATCH` that would take the gate away. For a provider whose network policy admits only Truto's Static Gate IPs, a connection without a gate could never make a call."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub requires_static_gate: Option<bool>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationJwtBearerCredentialConfigAuth {
#[serde(rename = "authorizeHost")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authorize_host: Option<String>,
#[serde(rename = "authorizePath")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authorize_path: Option<String>,
#[serde(rename = "tokenHost")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub token_host: Option<String>,
#[serde(rename = "tokenPath")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub token_path: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub method: Option<IntegrationJwtBearerCredentialConfigAuthMethod>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationJwtBearerCredentialConfigAuthMethod {
#[doc = " `POST`"]
Post,
#[doc = " `GET`"]
Get,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationJwtBearerCredentialConfigAuthMethod {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Post => "POST",
Self::Get => "GET",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationJwtBearerCredentialConfigAuthMethod {
fn from(s: &str) -> Self {
match s {
"POST" => Self::Post,
"GET" => Self::Get,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationJwtBearerCredentialConfigAuthMethod {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationJwtBearerCredentialConfigAuthMethod {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationJwtBearerCredentialConfigAuthMethod {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationJwtBearerCredentialConfigAuthMethod {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationJwtBearerCredentialConfigAuthMethod {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationJwtBearerCredentialConfigJwt {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub algorithm: Option<IntegrationJwtBearerCredentialConfigJwtAlgorithm>,
#[doc = " JWT claim template. Supports `{{...}}` placeholders (e.g. `iss` from `{{signing.id}}`)."]
pub claims: Map<String, Value>,
#[doc = " JSONata returning an object of claims, merged over `claims`. Evaluated over `{ context, signing: { id, public } }`, where `context` is the connection context without any private key. Never placeholder-substituted. `iat` and `exp` are always set by Truto, after it runs."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub claims_expression: Option<String>,
#[doc = " Assertion TTL in seconds. `exp` is set to `iat + expires_in` at sign time."]
pub expires_in: f64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scope_separator: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub header: Option<Map<String, Value>>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationJwtBearerCredentialConfigJwtAlgorithm {
#[doc = " `RS256`"]
Rs256,
#[doc = " `RS384`"]
Rs384,
#[doc = " `RS512`"]
Rs512,
#[doc = " `PS256`"]
Ps256,
#[doc = " `PS384`"]
Ps384,
#[doc = " `PS512`"]
Ps512,
#[doc = " `ES256`"]
Es256,
#[doc = " `ES384`"]
Es384,
#[doc = " `ES512`"]
Es512,
#[doc = " `EdDSA`"]
EdDSA,
#[doc = " `HS256`"]
Hs256,
#[doc = " `HS384`"]
Hs384,
#[doc = " `HS512`"]
Hs512,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationJwtBearerCredentialConfigJwtAlgorithm {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Rs256 => "RS256",
Self::Rs384 => "RS384",
Self::Rs512 => "RS512",
Self::Ps256 => "PS256",
Self::Ps384 => "PS384",
Self::Ps512 => "PS512",
Self::Es256 => "ES256",
Self::Es384 => "ES384",
Self::Es512 => "ES512",
Self::EdDSA => "EdDSA",
Self::Hs256 => "HS256",
Self::Hs384 => "HS384",
Self::Hs512 => "HS512",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationJwtBearerCredentialConfigJwtAlgorithm {
fn from(s: &str) -> Self {
match s {
"RS256" => Self::Rs256,
"RS384" => Self::Rs384,
"RS512" => Self::Rs512,
"PS256" => Self::Ps256,
"PS384" => Self::Ps384,
"PS512" => Self::Ps512,
"ES256" => Self::Es256,
"ES384" => Self::Es384,
"ES512" => Self::Es512,
"EdDSA" => Self::EdDSA,
"HS256" => Self::Hs256,
"HS384" => Self::Hs384,
"HS512" => Self::Hs512,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationJwtBearerCredentialConfigJwtAlgorithm {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationJwtBearerCredentialConfigJwtAlgorithm {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationJwtBearerCredentialConfigJwtAlgorithm {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationJwtBearerCredentialConfigJwtAlgorithm {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationJwtBearerCredentialConfigJwtAlgorithm {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationJwtBearerCredentialConfigOptions {
#[serde(rename = "authorizationMethod")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authorization_method: Option<IntegrationJwtBearerCredentialConfigOptionsAuthorizationMethod>,
#[serde(rename = "bodyFormat")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body_format: Option<IntegrationJwtBearerCredentialConfigOptionsBodyFormat>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub assertion_field_name: Option<String>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationJwtBearerCredentialConfigOptionsAuthorizationMethod {
#[doc = " `header`"]
Header,
#[doc = " `body`"]
Body,
#[doc = " `qs`"]
Qs,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationJwtBearerCredentialConfigOptionsAuthorizationMethod {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Header => "header",
Self::Body => "body",
Self::Qs => "qs",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationJwtBearerCredentialConfigOptionsAuthorizationMethod {
fn from(s: &str) -> Self {
match s {
"header" => Self::Header,
"body" => Self::Body,
"qs" => Self::Qs,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationJwtBearerCredentialConfigOptionsAuthorizationMethod {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationJwtBearerCredentialConfigOptionsAuthorizationMethod {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationJwtBearerCredentialConfigOptionsAuthorizationMethod {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationJwtBearerCredentialConfigOptionsAuthorizationMethod {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationJwtBearerCredentialConfigOptionsAuthorizationMethod {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationJwtBearerCredentialConfigOptionsBodyFormat {
#[doc = " `form`"]
Form,
#[doc = " `json`"]
Json,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationJwtBearerCredentialConfigOptionsBodyFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Form => "form",
Self::Json => "json",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationJwtBearerCredentialConfigOptionsBodyFormat {
fn from(s: &str) -> Self {
match s {
"form" => Self::Form,
"json" => Self::Json,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationJwtBearerCredentialConfigOptionsBodyFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationJwtBearerCredentialConfigOptionsBodyFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationJwtBearerCredentialConfigOptionsBodyFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationJwtBearerCredentialConfigOptionsBodyFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationJwtBearerCredentialConfigOptionsBodyFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " App/service identity and signing material (not OAuth `client_id` / `client_secret`). Set `key`, or `generated` to sign with a key pair Truto made for the connection; when `generated` is set, `key` is ignored."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationJwtBearerCredentialConfigSigning {
#[doc = " GitHub App ID, Google service account email, default `iss` claim, etc."]
pub id: String,
#[doc = " PEM, JWK JSON, or HMAC secret."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[doc = " Name of an `rsa_key_pair` entry in this credential's `generated_fields`. The JWT is signed with that key's private half, which is read directly and never through a `{{...}}` placeholder. Its public half is available to the claims as `signing.public` (`fingerprint`, `public_key`, `key_id`). A JWT signed with it lives at most 3600 seconds (`jwt.expires_in`), and `jwt.algorithm` must be `RS256`, `RS384`, `RS512`, `PS256`, `PS384` or `PS512`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub generated: Option<String>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationJwtBearerCredentialFormat {
#[doc = " `jwt_bearer`"]
JwtBearer,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationJwtBearerCredentialFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::JwtBearer => "jwt_bearer",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationJwtBearerCredentialFormat {
fn from(s: &str) -> Self {
match s {
"jwt_bearer" => Self::JwtBearer,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationJwtBearerCredentialFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationJwtBearerCredentialFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationJwtBearerCredentialFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationJwtBearerCredentialFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationJwtBearerCredentialFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Vendor-specific OAuth credential for Keka (HRMS). Combines an API key with an OAuth client."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationKekaOAuthCredential {
pub format: IntegrationKekaOAuthCredentialFormat,
pub config: IntegrationKekaOAuthCredentialConfig,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationKekaOAuthCredentialConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub client: Option<IntegrationKekaOAuthCredentialConfigClient>,
#[doc = " Custom label for this authentication method shown in the Connect UI."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
#[doc = " Short description shown below the label in the Connect UI when choosing between authentication methods."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub help_text: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub documentation_link: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub permissions_text: Option<String>,
pub fields: Vec<IntegrationField>,
#[doc = " Values Truto generates once per connection and stores in the integrated-account context under each entry's `name`. Declared instead of a `fields` entry when the provider requires the value to be generated by Truto rather than supplied by the customer — AWS's External ID is the first. A caller-supplied value for one of these names is ignored, and an existing value is never regenerated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub generated_fields: Option<Vec<IntegrationGeneratedField>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationKekaOAuthCredentialConfigClient {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub secret: Option<String>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationKekaOAuthCredentialFormat {
#[doc = " `keka_oauth`"]
KekaOauth,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationKekaOAuthCredentialFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::KekaOauth => "keka_oauth",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationKekaOAuthCredentialFormat {
fn from(s: &str) -> Self {
match s {
"keka_oauth" => Self::KekaOauth,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationKekaOAuthCredentialFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationKekaOAuthCredentialFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationKekaOAuthCredentialFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationKekaOAuthCredentialFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationKekaOAuthCredentialFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " RFC 5988 `Link:` header pagination (e.g. GitHub-style). The `next` and `prev` URLs are extracted from the response `Link` header."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationLinkHeaderPagination {
pub format: IntegrationLinkHeaderPaginationFormat,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<IntegrationLinkHeaderPaginationConfig>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationLinkHeaderPaginationConfig {
#[doc = " Informational only; the actual cursor comes from the `Link` header."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub page_key: Option<String>,
#[doc = " Query key that holds the page size when the caller sets `limit`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub limit_key: Option<String>,
#[doc = " Maximum page size Truto will request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub max_limit: Option<i64>,
#[doc = " Static or templated headers added to every paginated request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub headers: Option<BTreeMap<String, String>>,
#[doc = " Don't send `limit_key` even when the caller sets `limit`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ignore_limit: Option<bool>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationLinkHeaderPaginationFormat {
#[doc = " `link_header`"]
LinkHeader,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationLinkHeaderPaginationFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::LinkHeader => "link_header",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationLinkHeaderPaginationFormat {
fn from(s: &str) -> Self {
match s {
"link_header" => Self::LinkHeader,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationLinkHeaderPaginationFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationLinkHeaderPaginationFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationLinkHeaderPaginationFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationLinkHeaderPaginationFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationLinkHeaderPaginationFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " OAuth 2.0 client-credentials grant. Used for service-to-service integrations where there is no end-user."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationOAuth2ClientCredential {
pub format: IntegrationOAuth2ClientCredentialFormat,
pub config: IntegrationOAuth2ClientCredentialConfig,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationOAuth2ClientCredentialConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub client: Option<IntegrationOAuth2ClientCredentialConfigClient>,
#[doc = " Custom label for this authentication method shown in the Connect UI."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
#[doc = " Short description shown below the label in the Connect UI when choosing between authentication methods."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub help_text: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub documentation_link: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub permissions_text: Option<String>,
pub auth: IntegrationOAuth2ClientCredentialConfigAuth,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub options: Option<IntegrationOAuth2ClientCredentialConfigOptions>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub params: Option<BTreeMap<String, String>>,
pub fields: Vec<IntegrationField>,
#[doc = " Values Truto generates once per connection and stores in the integrated-account context under each entry's `name`. Declared instead of a `fields` entry when the provider requires the value to be generated by Truto rather than supplied by the customer — AWS's External ID is the first. A caller-supplied value for one of these names is ignored, and an existing value is never regenerated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub generated_fields: Option<Vec<IntegrationGeneratedField>>,
#[serde(rename = "tokenParams")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub token_params: Option<BTreeMap<String, String>>,
#[serde(rename = "refreshParams")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub refresh_params: Option<BTreeMap<String, String>>,
#[serde(rename = "tokenExpiryDuration")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub token_expiry_duration: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationOAuth2ClientCredentialConfigAuth {
#[serde(rename = "tokenHost")]
pub token_host: String,
#[serde(rename = "tokenPath")]
pub token_path: String,
#[doc = " Optional. Set if the integration also supports an interactive authorize step before falling back to client_credentials."]
#[serde(rename = "authorizeHost")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authorize_host: Option<String>,
#[serde(rename = "authorizePath")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authorize_path: Option<String>,
#[serde(rename = "refreshPath")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub refresh_path: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationOAuth2ClientCredentialConfigClient {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub secret: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationOAuth2ClientCredentialConfigOptions {
#[serde(rename = "scopeSeparator")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scope_separator: Option<String>,
#[serde(rename = "authorizationMethod")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authorization_method: Option<IntegrationOAuth2ClientCredentialConfigOptionsAuthorizationMethod>,
#[serde(rename = "bodyFormat")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body_format: Option<IntegrationOAuth2ClientCredentialConfigOptionsBodyFormat>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationOAuth2ClientCredentialConfigOptionsAuthorizationMethod {
#[doc = " `header`"]
Header,
#[doc = " `body`"]
Body,
#[doc = " `qs`"]
Qs,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationOAuth2ClientCredentialConfigOptionsAuthorizationMethod {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Header => "header",
Self::Body => "body",
Self::Qs => "qs",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationOAuth2ClientCredentialConfigOptionsAuthorizationMethod {
fn from(s: &str) -> Self {
match s {
"header" => Self::Header,
"body" => Self::Body,
"qs" => Self::Qs,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationOAuth2ClientCredentialConfigOptionsAuthorizationMethod {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationOAuth2ClientCredentialConfigOptionsAuthorizationMethod {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationOAuth2ClientCredentialConfigOptionsAuthorizationMethod {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationOAuth2ClientCredentialConfigOptionsAuthorizationMethod {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationOAuth2ClientCredentialConfigOptionsAuthorizationMethod {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationOAuth2ClientCredentialConfigOptionsBodyFormat {
#[doc = " `form`"]
Form,
#[doc = " `json`"]
Json,
#[doc = " `qs`"]
Qs,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationOAuth2ClientCredentialConfigOptionsBodyFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Form => "form",
Self::Json => "json",
Self::Qs => "qs",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationOAuth2ClientCredentialConfigOptionsBodyFormat {
fn from(s: &str) -> Self {
match s {
"form" => Self::Form,
"json" => Self::Json,
"qs" => Self::Qs,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationOAuth2ClientCredentialConfigOptionsBodyFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationOAuth2ClientCredentialConfigOptionsBodyFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationOAuth2ClientCredentialConfigOptionsBodyFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationOAuth2ClientCredentialConfigOptionsBodyFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationOAuth2ClientCredentialConfigOptionsBodyFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationOAuth2ClientCredentialFormat {
#[doc = " `oauth2_client_credentials`"]
Oauth2ClientCredentials,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationOAuth2ClientCredentialFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Oauth2ClientCredentials => "oauth2_client_credentials",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationOAuth2ClientCredentialFormat {
fn from(s: &str) -> Self {
match s {
"oauth2_client_credentials" => Self::Oauth2ClientCredentials,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationOAuth2ClientCredentialFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationOAuth2ClientCredentialFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationOAuth2ClientCredentialFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationOAuth2ClientCredentialFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationOAuth2ClientCredentialFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " OAuth 2.0 authorization-code flow credential."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationOAuth2Credential {
pub format: IntegrationOAuth2CredentialFormat,
pub config: IntegrationOAuth2CredentialConfig,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationOAuth2CredentialConfig {
#[doc = " Default Truto-managed OAuth client. Customers may supply their own via BYOA (Bring Your Own App)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub client: Option<IntegrationOAuth2CredentialConfigClient>,
#[doc = " Endpoint URLs for the OAuth dance."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub auth: Option<IntegrationOAuth2CredentialConfigAuth>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub options: Option<IntegrationOAuth2CredentialConfigOptions>,
#[doc = " Extra params appended to the authorize URL."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub params: Option<BTreeMap<String, String>>,
#[doc = " Extra params appended to the token-exchange request body."]
#[serde(rename = "tokenParams")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub token_params: Option<BTreeMap<String, String>>,
#[doc = " Extra params appended to the token-refresh request body."]
#[serde(rename = "refreshParams")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub refresh_params: Option<BTreeMap<String, String>>,
#[doc = " Custom label for this authentication method shown in the Connect UI."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
#[doc = " Short description shown below the label in the Connect UI when choosing between authentication methods."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub help_text: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub documentation_link: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub permissions_text: Option<String>,
#[doc = " Optional extra customer-collected fields (e.g. `subdomain` for vendors that need it before the OAuth dance)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub fields: Option<Vec<IntegrationField>>,
#[doc = " Values Truto generates once per connection and stores in the integrated-account context under each entry's `name`. Declared instead of a `fields` entry when the provider requires the value to be generated by Truto rather than supplied by the customer — AWS's External ID is the first. A caller-supplied value for one of these names is ignored, and an existing value is never regenerated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub generated_fields: Option<Vec<IntegrationGeneratedField>>,
#[doc = " Required OAuth scopes always requested."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scope: Option<Vec<String>>,
#[doc = " Scopes that may be requested if available; failures don't abort the dance."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub optional_scope: Option<Vec<String>>,
#[doc = " When true, store the scope returned by the OAuth provider on the credential rather than the requested scope."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub use_oauth_token_scope: Option<bool>,
#[doc = " Override for the separator used when serializing scopes (defaults to a space)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub oauth_token_scope_separator: Option<String>,
#[doc = " Optional PKCE configuration. Required by some OAuth 2.0 providers."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pkce: Option<IntegrationOAuth2CredentialConfigPkce>,
#[doc = " Static token TTL (as a string of seconds) used when the provider doesn't return one."]
#[serde(rename = "tokenExpiryDuration")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub token_expiry_duration: Option<String>,
}
#[doc = " Endpoint URLs for the OAuth dance."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationOAuth2CredentialConfigAuth {
#[serde(rename = "tokenHost")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub token_host: Option<String>,
#[serde(rename = "tokenPath")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub token_path: Option<String>,
#[serde(rename = "authorizeHost")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authorize_host: Option<String>,
#[serde(rename = "authorizePath")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authorize_path: Option<String>,
#[serde(rename = "revokePath")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub revoke_path: Option<String>,
#[serde(rename = "refreshPath")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub refresh_path: Option<String>,
}
#[doc = " Default Truto-managed OAuth client. Customers may supply their own via BYOA (Bring Your Own App)."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationOAuth2CredentialConfigClient {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub secret: Option<String>,
#[doc = " Optional override for the OAuth `client_id` parameter name (defaults to `client_id`)."]
#[serde(rename = "idParamName")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id_param_name: Option<String>,
#[doc = " Optional override for the OAuth `client_secret` parameter name (defaults to `client_secret`)."]
#[serde(rename = "secretParamName")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub secret_param_name: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationOAuth2CredentialConfigOptions {
#[serde(rename = "scopeSeparator")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scope_separator: Option<String>,
#[serde(rename = "authorizationMethod")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authorization_method: Option<IntegrationOAuth2CredentialConfigOptionsAuthorizationMethod>,
#[serde(rename = "bodyFormat")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body_format: Option<IntegrationOAuth2CredentialConfigOptionsBodyFormat>,
#[doc = " Name of the response property that holds the token TTL in seconds."]
#[serde(rename = "expiresInPropertyName")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expires_in_property_name: Option<String>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationOAuth2CredentialConfigOptionsAuthorizationMethod {
#[doc = " `header`"]
Header,
#[doc = " `body`"]
Body,
#[doc = " `qs`"]
Qs,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationOAuth2CredentialConfigOptionsAuthorizationMethod {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Header => "header",
Self::Body => "body",
Self::Qs => "qs",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationOAuth2CredentialConfigOptionsAuthorizationMethod {
fn from(s: &str) -> Self {
match s {
"header" => Self::Header,
"body" => Self::Body,
"qs" => Self::Qs,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationOAuth2CredentialConfigOptionsAuthorizationMethod {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationOAuth2CredentialConfigOptionsAuthorizationMethod {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationOAuth2CredentialConfigOptionsAuthorizationMethod {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationOAuth2CredentialConfigOptionsAuthorizationMethod {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationOAuth2CredentialConfigOptionsAuthorizationMethod {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationOAuth2CredentialConfigOptionsBodyFormat {
#[doc = " `form`"]
Form,
#[doc = " `json`"]
Json,
#[doc = " `qs`"]
Qs,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationOAuth2CredentialConfigOptionsBodyFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Form => "form",
Self::Json => "json",
Self::Qs => "qs",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationOAuth2CredentialConfigOptionsBodyFormat {
fn from(s: &str) -> Self {
match s {
"form" => Self::Form,
"json" => Self::Json,
"qs" => Self::Qs,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationOAuth2CredentialConfigOptionsBodyFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationOAuth2CredentialConfigOptionsBodyFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationOAuth2CredentialConfigOptionsBodyFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationOAuth2CredentialConfigOptionsBodyFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationOAuth2CredentialConfigOptionsBodyFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Optional PKCE configuration. Required by some OAuth 2.0 providers."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationOAuth2CredentialConfigPkce {
pub method: IntegrationOAuth2CredentialConfigPkceMethod,
#[serde(rename = "challengeKey")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub challenge_key: Option<String>,
#[serde(rename = "challengeMethodKey")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub challenge_method_key: Option<String>,
#[serde(rename = "challengeVerifierKey")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub challenge_verifier_key: Option<String>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationOAuth2CredentialConfigPkceMethod {
#[doc = " `S256`"]
S256,
#[doc = " `plain`"]
Plain,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationOAuth2CredentialConfigPkceMethod {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::S256 => "S256",
Self::Plain => "plain",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationOAuth2CredentialConfigPkceMethod {
fn from(s: &str) -> Self {
match s {
"S256" => Self::S256,
"plain" => Self::Plain,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationOAuth2CredentialConfigPkceMethod {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationOAuth2CredentialConfigPkceMethod {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationOAuth2CredentialConfigPkceMethod {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationOAuth2CredentialConfigPkceMethod {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationOAuth2CredentialConfigPkceMethod {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationOAuth2CredentialFormat {
#[doc = " `oauth2`"]
Oauth2,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationOAuth2CredentialFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Oauth2 => "oauth2",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationOAuth2CredentialFormat {
fn from(s: &str) -> Self {
match s {
"oauth2" => Self::Oauth2,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationOAuth2CredentialFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationOAuth2CredentialFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationOAuth2CredentialFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationOAuth2CredentialFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationOAuth2CredentialFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " OAuth 1.0a credential (rare; used for legacy APIs like older Twitter, Trello)."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationOAuthCredential {
pub format: IntegrationOAuthCredentialFormat,
pub config: IntegrationOAuthCredentialConfig,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationOAuthCredentialConfig {
pub client: IntegrationOAuthCredentialConfigClient,
pub auth: IntegrationOAuthCredentialConfigAuth,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub options: Option<IntegrationOAuthCredentialConfigOptions>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scope: Option<Vec<String>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub params: Option<BTreeMap<String, String>>,
#[serde(rename = "tokenParams")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub token_params: Option<BTreeMap<String, String>>,
#[serde(rename = "refreshParams")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub refresh_params: Option<BTreeMap<String, String>>,
#[doc = " Custom label for this authentication method shown in the Connect UI."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
#[doc = " Short description shown below the label in the Connect UI when choosing between authentication methods."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub help_text: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub documentation_link: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub permissions_text: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub fields: Option<Vec<IntegrationField>>,
#[doc = " Values Truto generates once per connection and stores in the integrated-account context under each entry's `name`. Declared instead of a `fields` entry when the provider requires the value to be generated by Truto rather than supplied by the customer — AWS's External ID is the first. A caller-supplied value for one of these names is ignored, and an existing value is never regenerated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub generated_fields: Option<Vec<IntegrationGeneratedField>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationOAuthCredentialConfigAuth {
#[serde(rename = "requestTokenUrl")]
pub request_token_url: String,
#[serde(rename = "authorizeUrl")]
pub authorize_url: String,
#[serde(rename = "tokenUrl")]
pub token_url: String,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationOAuthCredentialConfigClient {
pub id: String,
pub secret: String,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationOAuthCredentialConfigOptions {
#[serde(rename = "signatureMethod")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub signature_method: Option<IntegrationOAuthCredentialConfigOptionsSignatureMethod>,
#[serde(rename = "addToQuery")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub add_to_query: Option<bool>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationOAuthCredentialConfigOptionsSignatureMethod {
#[doc = " `HMAC-SHA1`"]
HmacSha1,
#[doc = " `PLAINTEXT`"]
Plaintext,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationOAuthCredentialConfigOptionsSignatureMethod {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::HmacSha1 => "HMAC-SHA1",
Self::Plaintext => "PLAINTEXT",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationOAuthCredentialConfigOptionsSignatureMethod {
fn from(s: &str) -> Self {
match s {
"HMAC-SHA1" => Self::HmacSha1,
"PLAINTEXT" => Self::Plaintext,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationOAuthCredentialConfigOptionsSignatureMethod {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationOAuthCredentialConfigOptionsSignatureMethod {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationOAuthCredentialConfigOptionsSignatureMethod {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationOAuthCredentialConfigOptionsSignatureMethod {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationOAuthCredentialConfigOptionsSignatureMethod {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationOAuthCredentialFormat {
#[doc = " `oauth`"]
Oauth,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationOAuthCredentialFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Oauth => "oauth",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationOAuthCredentialFormat {
fn from(s: &str) -> Self {
match s {
"oauth" => Self::Oauth,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationOAuthCredentialFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationOAuthCredentialFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationOAuthCredentialFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationOAuthCredentialFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationOAuthCredentialFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Offset/limit pagination (`?offset=200&limit=100`)."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationOffsetPagination {
pub format: IntegrationOffsetPaginationFormat,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<IntegrationOffsetPaginationConfig>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationOffsetPaginationConfig {
#[doc = " Optional dotted-path accessor into the response body that yields the total result count, used to stop paginating early."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub total_path: Option<String>,
#[doc = " Query/body key that holds the offset."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub offset_key: Option<String>,
#[doc = " Query/body key that holds the page size."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub limit_key: Option<String>,
#[doc = " Maximum page size Truto will request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub max_limit: Option<i64>,
#[doc = " Static or templated headers added to every paginated request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub headers: Option<BTreeMap<String, String>>,
#[doc = " Send pagination params in the request body instead of the query string."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub add_to_body: Option<bool>,
#[doc = " Offset used for the first request (some APIs are 1-indexed)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub default_offset: Option<String>,
#[doc = " Send pagination params in the query string."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub add_to_query: Option<bool>,
#[doc = " Detect loops by hashing each page's results."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub use_content_hash: Option<bool>,
#[doc = " Drop `limit_key` from the URL after pagination is applied."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ignore_limit: Option<bool>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationOffsetPaginationFormat {
#[doc = " `offset`"]
Offset,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationOffsetPaginationFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Offset => "offset",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationOffsetPaginationFormat {
fn from(s: &str) -> Self {
match s {
"offset" => Self::Offset,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationOffsetPaginationFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationOffsetPaginationFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationOffsetPaginationFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationOffsetPaginationFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationOffsetPaginationFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Page-number pagination (e.g. `?page=2&limit=100`)."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationPagePagination {
pub format: IntegrationPagePaginationFormat,
#[doc = " Page-number pagination options. All fields optional; defaults shown."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<IntegrationPagePaginationConfig>,
}
#[doc = " Page-number pagination options. All fields optional; defaults shown."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationPagePaginationConfig {
#[doc = " Query/body key that holds the page number."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub page_key: Option<String>,
#[doc = " Query/body key that holds the page size."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub limit_key: Option<String>,
#[doc = " Maximum page size Truto will request, regardless of the caller's `limit`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub max_limit: Option<i64>,
#[doc = " Page number used for the first page (some APIs are 0-indexed)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub starting_page: Option<String>,
#[doc = " Static or templated headers added to every paginated request. Templated against the request `query` plus a synthetic `limit`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub headers: Option<BTreeMap<String, String>>,
#[doc = " Drop the `limit_key` from the URL after pagination is applied (for APIs that 400 on it)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ignore_limit: Option<bool>,
#[doc = " Add pagination keys to the request body instead of the query string."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub add_to_body: Option<bool>,
#[doc = " Add pagination keys to the query string. Defaults to `true` when `add_to_body` is false."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub add_to_query: Option<bool>,
#[doc = " Stop paginating when consecutive pages return identical results (loop detection). Defaults to `true`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub use_content_hash: Option<bool>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationPagePaginationFormat {
#[doc = " `page`"]
Page,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationPagePaginationFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Page => "page",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationPagePaginationFormat {
fn from(s: &str) -> Self {
match s {
"page" => Self::Page,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationPagePaginationFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationPagePaginationFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationPagePaginationFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationPagePaginationFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationPagePaginationFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Pagination strategy for an integration or a single resource method. The `format` discriminator selects which `config` shape applies."]
///
/// Union type: holds the raw JSON and decodes a variant on demand.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(transparent)]
pub struct IntegrationPagination(pub Value);
impl IntegrationPagination {
/// The raw JSON value.
pub fn raw(&self) -> &Value {
&self.0
}
/// Consume the wrapper and return the raw JSON value.
pub fn into_raw(self) -> Value {
self.0
}
/// Decode the value as [`IntegrationPagePagination`].
pub fn as_integration_page_pagination(&self) -> Result<IntegrationPagePagination, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`IntegrationCursorPagination`].
pub fn as_integration_cursor_pagination(&self) -> Result<IntegrationCursorPagination, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`IntegrationLinkHeaderPagination`].
pub fn as_integration_link_header_pagination(&self) -> Result<IntegrationLinkHeaderPagination, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`IntegrationOffsetPagination`].
pub fn as_integration_offset_pagination(&self) -> Result<IntegrationOffsetPagination, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`IntegrationRangePagination`].
pub fn as_integration_range_pagination(&self) -> Result<IntegrationRangePagination, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`IntegrationDynamicPagination`].
pub fn as_integration_dynamic_pagination(&self) -> Result<IntegrationDynamicPagination, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
}
impl From<IntegrationPagePagination> for IntegrationPagination {
fn from(v: IntegrationPagePagination) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<IntegrationCursorPagination> for IntegrationPagination {
fn from(v: IntegrationCursorPagination) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<IntegrationLinkHeaderPagination> for IntegrationPagination {
fn from(v: IntegrationLinkHeaderPagination) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<IntegrationOffsetPagination> for IntegrationPagination {
fn from(v: IntegrationOffsetPagination) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<IntegrationRangePagination> for IntegrationPagination {
fn from(v: IntegrationRangePagination) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<IntegrationDynamicPagination> for IntegrationPagination {
fn from(v: IntegrationDynamicPagination) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<Value> for IntegrationPagination {
fn from(v: Value) -> Self {
Self(v)
}
}
#[doc = " Runtime request context used to resolve every `{{...}}` placeholder in an integration config (`headers`, `query`, `body`, `path`, etc.) and to seed every `update_context` action step. Built per request from the integrated-account context plus the current call's parameters."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationPlaceholderContext {
#[doc = " The path/resource ID for `*.get`/`*.update`/`*.delete` calls. Read as `{{id}}` and auto URL-encoded when used inside `path`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " Caller-supplied query params. Read as `{{query.<key>}}`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query: Option<Map<String, Value>>,
#[doc = " Caller-supplied request body. Read as `{{body}}` (whole body) or `{{body.<key>}}`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body: Option<Value>,
#[doc = " OAuth context. Tokens are nested under `oauth.token` (e.g. `{{oauth.token.access_token}}`, `{{oauth.token.refresh_token}}`)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub oauth: Option<IntegrationPlaceholderContextOauth>,
#[doc = " Environment-scoped variables defined under Settings → Environment Variables. Read as `{{environment_variables.<NAME>}}`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_variables: Option<BTreeMap<String, String>>,
#[doc = " The authentication format the integrated account was created with (`api_key`, `oauth2`, `oauth`, `oauth2_client_credentials`, `keka_oauth`, `jwt_bearer`, `aws_sts`). Useful when the same integration supports multiple credential formats."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub truto_authentication_method: Option<String>,
#[doc = " The credential slot this request resolved to, on an `aws_sts` connection. An `authorization` expression selects the credential with `$lookup(context.oauth.tokens, context.truto_token_key)`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub truto_token_key: Option<String>,
#[doc = " When the request is routed via a static-gate environment variable, this holds the gate ID."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub truto_static_gate_id: Option<String>,
}
#[doc = " OAuth context. Tokens are nested under `oauth.token` (e.g. `{{oauth.token.access_token}}`, `{{oauth.token.refresh_token}}`)."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationPlaceholderContextOauth {
#[doc = " OAuth token bag merged from the most recent token-refresh response."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub token: Option<IntegrationPlaceholderContextOauthToken>,
}
#[doc = " OAuth token bag merged from the most recent token-refresh response."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationPlaceholderContextOauthToken {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub access_token: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub refresh_token: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expires_in: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub token_type: Option<String>,
}
#[doc = " Half-open `[start, end)` range pagination (e.g. `?start=0&end=100` then `?start=100&end=200`)."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationRangePagination {
pub format: IntegrationRangePaginationFormat,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<IntegrationRangePaginationConfig>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationRangePaginationConfig {
#[doc = " Optional dotted-path accessor into the response body that yields the total result count, used to stop paginating early."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub total_path: Option<String>,
#[doc = " Query/body key that holds the start of the range."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub start_key: Option<String>,
#[doc = " Query/body key that holds the end of the range (exclusive)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub end_key: Option<String>,
#[doc = " Maximum range size Truto will request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub max_limit: Option<i64>,
#[doc = " Static or templated headers added to every paginated request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub headers: Option<BTreeMap<String, String>>,
#[doc = " Send pagination params in the request body instead of the query string."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub add_to_body: Option<bool>,
#[doc = " Send pagination params in the query string."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub add_to_query: Option<bool>,
#[doc = " Start value used for the first request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub default_start: Option<String>,
#[doc = " Drop `start_key`, `end_key`, and `limit` from the URL after pagination is applied."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ignore_limit: Option<bool>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationRangePaginationFormat {
#[doc = " `range`"]
Range,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationRangePaginationFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Range => "range",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationRangePaginationFormat {
fn from(s: &str) -> Self {
match s {
"range" => Self::Range,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationRangePaginationFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationRangePaginationFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationRangePaginationFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationRangePaginationFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationRangePaginationFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " How Truto detects and reacts to upstream rate-limiting. All fields are JSONata expressions evaluated against the upstream response."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationRateLimit {
#[doc = " JSONata expression returning a truthy value when the response should be treated as rate-limited. When omitted, Truto falls back to `status === 429`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_rate_limited: Option<String>,
#[doc = " JSONata expression returning the seconds to wait before retrying. When omitted, Truto reads the standard `Retry-After` header."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub retry_after_header_expression: Option<String>,
#[doc = " JSONata expression returning the current rate-limit window state. Truto forwards this as `RateLimit-Limit` / `RateLimit-Remaining` / `RateLimit-Reset` headers in the proxy response."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub rate_limit_header_expression: Option<String>,
}
#[doc = " Input passed to `rate_limit.is_rate_limited`, `rate_limit.retry_after_header_expression`, and `rate_limit.rate_limit_header_expression`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationRateLimitExpressionContext {
#[doc = " HTTP status code of the upstream response."]
pub status: i64,
#[doc = " Lower-cased response headers from the upstream call."]
pub headers: BTreeMap<String, String>,
}
#[doc = " Return value from `rate_limit.rate_limit_header_expression`. Truto rewrites these into the standard `ratelimit-limit`, `ratelimit-remaining`, and `ratelimit-reset` response headers."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationRateLimitHeaderValues {
#[doc = " Total requests allowed in the current window."]
pub limit: String,
#[doc = " Requests remaining in the current window."]
pub remaining: String,
#[doc = " When the current window resets — typically a Unix timestamp or ISO date string, exactly as the upstream returned it."]
pub reset: String,
}
#[doc = " Definition of a single resource method (e.g. `users.list`) for an integration."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationResourceMethod {
#[doc = " Override the integration-level `base_url` for this single method. Supports placeholders."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub base_url: Option<String>,
#[doc = " HTTP method. Includes WebDAV/CalDAV verbs (e.g. `propfind`, `report`) for integrations such as Apple/iCloud Calendar."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub method: Option<IntegrationResourceMethodMethod>,
#[doc = " URL path appended to `base_url`. Supports placeholders — `{{id}}` for the path parameter (auto URL-encoded), `{{query.foo}}` for caller query params, `{{<field-name>}}` for credential fields, `{{environment_variables.MY_VAR}}` for env-vars, etc."]
pub path: String,
#[doc = " Optional alternate path to call when paginating (e.g. when the first page comes from `/users` but subsequent pages come from a `next_url` field). Supports placeholders."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pagination_path: Option<String>,
#[doc = " Override the integration-level `authorization` for this method (e.g. a method that uses a different credential format than the rest of the integration)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authorization: Option<IntegrationAuthorization>,
#[doc = " Static or templated request headers merged with the integration-level `headers`. Values are templated with placeholders; `null` removes the inherited header."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub headers: Option<BTreeMap<String, Option<String>>>,
#[doc = " Static or templated query-string params merged with caller-supplied `query`. Values may be strings, numbers, booleans, arrays, or placeholders. Array serialization is controlled by `query_array_format`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query: Option<Map<String, Value>>,
#[doc = " How array values are serialized in the query string. `comma` → `?a=1,2`; `brackets` → `?a[]=1&a[]=2`; `indices` → `?a[0]=1&a[1]=2`; `repeat` → `?a=1&a=2`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query_array_format: Option<IntegrationResourceMethodQueryArrayFormat>,
#[doc = " JSON-schema-style declaration of supported query params used by Truto's MCP/tooling. May be a JSONata string for dynamic schemas, or a `JsonSchemaObject`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query_schema: Option<Value>,
#[doc = " JSON-schema-style declaration of the supported request body used by Truto's MCP/tooling. May be a JSONata string for dynamic schemas, or a `JsonSchemaObject`. The runtime (see `src/mcp/mcpRouter.ts`) reads `body_schema.properties`, so callers should emit the wrapped `JsonSchemaObject` shape `{ type \"object\", properties { ... } }` rather than a flat `{ name { type \"string\" } }` map."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body_schema: Option<Value>,
#[doc = " How the request body is serialized: * `json` — JSON-encoded (default). * `form` — `application/x-www-form-urlencoded`. * `multipart` — `multipart/form-data`. See `IntegrationResourceMethodBodyFormatConfigMultipart` for tuning options. The file field is declared in `body_schema` as `type: string, format: binary`. * `raw` — sent verbatim, with `Content-Type` set from `body_format_config.content_type`. For a file upload `body_schema` has exactly one property, `file` as `type: string, format: binary`; for a raw text body, a single plain `type: string` property. `raw` is also used to send a structured body under its own content type (for example `application/vnd.api+json` or `application/scim+json`), which is not a file and keeps an ordinary `body_schema`. * `xml` — converted to XML and sent as `application/xml`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body_format: Option<IntegrationResourceMethodBodyFormat>,
#[doc = " Extra options for the chosen `body_format`. Discriminated by the sibling `body_format` field — see `IntegrationResourceMethodBodyFormatConfigRaw` (for `raw`) and `IntegrationResourceMethodBodyFormatConfigMultipart` (for `multipart`). Ignored for `json`/`form`/`xml`. `anyOf`, not `oneOf`: the multipart shape has no required keys and no `additionalProperties: false`, so a raw config (`{ content_type }`) also satisfies it and `oneOf` rejected every raw method."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body_format_config: Option<IntegrationResourceMethodBodyFormatConfig>,
#[doc = " JSON-schema-style declaration of the response payload used by Truto's MCP/tooling."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response_schema: Option<Value>,
#[doc = " Dotted-path accessor (e.g. `data.results`, `payload.users.*`, `result.0.items`) into the parsed response that contains the canonical resource (or array of resources). Defaults to the root. This is a path lookup, **not** a JSONata expression."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response_path: Option<String>,
#[doc = " Override the integration-level pagination for this single method. Set to `null` to disable pagination on a method that would otherwise inherit it."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pagination: Option<IntegrationPagination>,
#[doc = " For `post`/`put`/`patch` methods, copy the caller-supplied query params into the body before sending."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub add_query_to_body: Option<bool>,
#[doc = " Don't re-send the body when fetching subsequent pagination pages."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ignore_body_in_pagination: Option<bool>,
#[doc = " Drop the body entirely (useful for vendors that 400 on empty bodies)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ignore_body: Option<bool>,
#[doc = " Send a literal JSON `null` instead of an empty body."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub set_body_to_null: Option<bool>,
#[doc = " Skip applying the integration's authorization to this method (e.g. a public health check)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub no_auth: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub examples: Option<IntegrationResourceMethodExample>,
#[doc = " Strip the Authorization header when the upstream issues a redirect to a different host."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ignore_credentials_on_redirect: Option<bool>,
#[doc = " Override the response parser (e.g. `xml`, `text`)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub api_response_format: Option<String>,
#[doc = " When true, fail loudly if the response can't be parsed; otherwise return a structured error."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub throw_error_on_parse_error: Option<bool>,
#[doc = " JSONata expression evaluated on every response (success or failure). Use to detect errors in successful (2xx) responses, normalize error messages, or transform \"errors\" with `< 400` status into successful responses with the `result` you return."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error_expression: Option<String>,
#[doc = " Human-readable description of the method, used in MCP tool listings."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[doc = " URL to the upstream vendor's documentation for this method."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub api_documentation_url: Option<String>,
#[doc = " Permissions required to call this method, **all** of which are needed. Usually OAuth scopes, but an integration that issues no OAuth grant, or whose permissions are role names, writes those here instead — which vocabulary is in use is derived from the integration, or declared here with `permission_vocabulary`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scopes: Option<Vec<String>>,
#[doc = " Permissions of which holding **any one** is enough, kept apart from `scopes` (which is all-of). Providers say so explicitly — Microsoft Graph answers a 403 with \"API requires one of 'Chat.ReadBasic.All, Chat.Read.All, Chat.ReadWrite.All'\" — and treating that as all-of reports scopes as missing that the operation never needed."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scopes_any_of: Option<Vec<String>>,
#[doc = " Which vocabulary `scopes` and `scopes_any_of` above are written in, declared rather than inferred. Normally omitted: Truto derives this from configuration that already exists, so every integration is classified without anyone labelling it. Set it only to correct a derivation that reads an integration wrongly."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub permission_vocabulary: Option<IntegrationResourceMethodPermissionVocabulary>,
#[doc = " Hints mirroring MCP `ToolAnnotations` for this method's tool, read by consumers that classify tools (e.g. Elaichi) to decide read, write or destructive. Keys keep the MCP spec's camelCase spelling on purpose. Absent means \"no hint\": consumers fall back to their existing rules, and a missing flag is not read as `false`. `readOnlyHint` and `destructiveHint` cannot both be `true`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mcp_annotations: Option<IntegrationResourceMethodMcpAnnotations>,
#[doc = " Steps to run before this method's own request: an array of steps run in order, or a string naming a sibling method whose steps are reused. Same step shape as a unified model mapping's `before`. Accepted and stored so engines that run proxy configs can execute it; **Truto's own proxy does not run it yet**, so on Truto this is inert. Each step's `run_if` must parse as JSONata, or the write is a 400."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub before: Option<Value>,
#[doc = " Static or templated request body for `post`/`put`/`patch` methods. Any JSON value (usually an object, sometimes an array) and may include placeholders. Use `$truto_merge` with `:json` to deep-merge an entire object; see placeholder syntax."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body: Option<Value>,
}
#[doc = " How the request body is serialized: * `json` — JSON-encoded (default). * `form` — `application/x-www-form-urlencoded`. * `multipart` — `multipart/form-data`. See `IntegrationResourceMethodBodyFormatConfigMultipart` for tuning options. The file field is declared in `body_schema` as `type: string, format: binary`. * `raw` — sent verbatim, with `Content-Type` set from `body_format_config.content_type`. For a file upload `body_schema` has exactly one property, `file` as `type: string, format: binary`; for a raw text body, a single plain `type: string` property. `raw` is also used to send a structured body under its own content type (for example `application/vnd.api+json` or `application/scim+json`), which is not a file and keeps an ordinary `body_schema`. * `xml` — converted to XML and sent as `application/xml`."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationResourceMethodBodyFormat {
#[doc = " `json`"]
Json,
#[doc = " `form`"]
Form,
#[doc = " `multipart`"]
Multipart,
#[doc = " `raw`"]
Raw,
#[doc = " `xml`"]
Xml,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationResourceMethodBodyFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Json => "json",
Self::Form => "form",
Self::Multipart => "multipart",
Self::Raw => "raw",
Self::Xml => "xml",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationResourceMethodBodyFormat {
fn from(s: &str) -> Self {
match s {
"json" => Self::Json,
"form" => Self::Form,
"multipart" => Self::Multipart,
"raw" => Self::Raw,
"xml" => Self::Xml,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationResourceMethodBodyFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationResourceMethodBodyFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationResourceMethodBodyFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationResourceMethodBodyFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationResourceMethodBodyFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Extra options for the chosen `body_format`. Discriminated by the sibling `body_format` field — see `IntegrationResourceMethodBodyFormatConfigRaw` (for `raw`) and `IntegrationResourceMethodBodyFormatConfigMultipart` (for `multipart`). Ignored for `json`/`form`/`xml`. `anyOf`, not `oneOf`: the multipart shape has no required keys and no `additionalProperties: false`, so a raw config (`{ content_type }`) also satisfies it and `oneOf` rejected every raw method."]
///
/// Union type: holds the raw JSON and decodes a variant on demand.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(transparent)]
pub struct IntegrationResourceMethodBodyFormatConfig(pub Value);
impl IntegrationResourceMethodBodyFormatConfig {
/// The raw JSON value.
pub fn raw(&self) -> &Value {
&self.0
}
/// Consume the wrapper and return the raw JSON value.
pub fn into_raw(self) -> Value {
self.0
}
/// Decode the value as [`IntegrationResourceMethodBodyFormatConfigRaw`].
pub fn as_integration_resource_method_body_format_config_raw(&self) -> Result<IntegrationResourceMethodBodyFormatConfigRaw, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`IntegrationResourceMethodBodyFormatConfigMultipart`].
pub fn as_integration_resource_method_body_format_config_multipart(&self) -> Result<IntegrationResourceMethodBodyFormatConfigMultipart, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
}
impl From<IntegrationResourceMethodBodyFormatConfigRaw> for IntegrationResourceMethodBodyFormatConfig {
fn from(v: IntegrationResourceMethodBodyFormatConfigRaw) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<IntegrationResourceMethodBodyFormatConfigMultipart> for IntegrationResourceMethodBodyFormatConfig {
fn from(v: IntegrationResourceMethodBodyFormatConfigMultipart) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<Value> for IntegrationResourceMethodBodyFormatConfig {
fn from(v: Value) -> Self {
Self(v)
}
}
#[doc = " `body_format_config` shape when `body_format` is `multipart`. Tunes how nested JSON values are serialized into multipart fields."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationResourceMethodBodyFormatConfigMultipart {
#[doc = " When true (the default), indexed leaf arrays are serialized as `field[0]=a&field[1]=b`; when false, as `field[]=a&field[]=b`."]
#[serde(rename = "showLeafArrayIndexes")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub show_leaf_array_indexes: Option<bool>,
#[doc = " When true, `null` values are sent as the literal string `\"null\"`. Defaults to `false` (omitted)."]
#[serde(rename = "includeNullValues")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub include_null_values: Option<bool>,
#[doc = " Optional pre-serialization value mapper. Keyed by JSON type; each value is a function that returns a string. Rarely needed."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mapping: Option<Map<String, Value>>,
}
#[doc = " `body_format_config` shape when `body_format` is `raw`. The body is sent verbatim with the configured `content_type`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationResourceMethodBodyFormatConfigRaw {
#[doc = " `Content-Type` header to attach to the raw body."]
pub content_type: String,
}
#[doc = " Sample request/response payloads used by docs and the Truto MCP for tool descriptions."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationResourceMethodExample {
#[doc = " Sample response body (typically pretty-printed JSON, stored as a string)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response: Option<String>,
#[doc = " Sample query-string params (stored as a string)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query: Option<String>,
#[doc = " Sample request body (typically pretty-printed JSON, stored as a string)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body: Option<String>,
}
#[doc = " Hints mirroring MCP `ToolAnnotations` for this method's tool, read by consumers that classify tools (e.g. Elaichi) to decide read, write or destructive. Keys keep the MCP spec's camelCase spelling on purpose. Absent means \"no hint\": consumers fall back to their existing rules, and a missing flag is not read as `false`. `readOnlyHint` and `destructiveHint` cannot both be `true`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationResourceMethodMcpAnnotations {
#[doc = " The tool does not modify its environment."]
#[serde(rename = "readOnlyHint")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub read_only_hint: Option<bool>,
#[doc = " The tool may perform destructive updates (as opposed to purely additive ones)."]
#[serde(rename = "destructiveHint")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub destructive_hint: Option<bool>,
#[doc = " Calling the tool repeatedly with the same arguments has no additional effect."]
#[serde(rename = "idempotentHint")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub idempotent_hint: Option<bool>,
#[doc = " The tool interacts with an open world of external entities (as opposed to a closed domain)."]
#[serde(rename = "openWorldHint")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub open_world_hint: Option<bool>,
}
#[doc = " HTTP method. Includes WebDAV/CalDAV verbs (e.g. `propfind`, `report`) for integrations such as Apple/iCloud Calendar."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationResourceMethodMethod {
#[doc = " `get`"]
Get,
#[doc = " `post`"]
Post,
#[doc = " `put`"]
Put,
#[doc = " `patch`"]
Patch,
#[doc = " `delete`"]
Delete,
#[doc = " `options`"]
Options,
#[doc = " `propfind`"]
Propfind,
#[doc = " `report`"]
Report,
#[doc = " `proppatch`"]
Proppatch,
#[doc = " `mkcalendar`"]
Mkcalendar,
#[doc = " `mkcol`"]
Mkcol,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationResourceMethodMethod {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Get => "get",
Self::Post => "post",
Self::Put => "put",
Self::Patch => "patch",
Self::Delete => "delete",
Self::Options => "options",
Self::Propfind => "propfind",
Self::Report => "report",
Self::Proppatch => "proppatch",
Self::Mkcalendar => "mkcalendar",
Self::Mkcol => "mkcol",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationResourceMethodMethod {
fn from(s: &str) -> Self {
match s {
"get" => Self::Get,
"post" => Self::Post,
"put" => Self::Put,
"patch" => Self::Patch,
"delete" => Self::Delete,
"options" => Self::Options,
"propfind" => Self::Propfind,
"report" => Self::Report,
"proppatch" => Self::Proppatch,
"mkcalendar" => Self::Mkcalendar,
"mkcol" => Self::Mkcol,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationResourceMethodMethod {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationResourceMethodMethod {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationResourceMethodMethod {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationResourceMethodMethod {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationResourceMethodMethod {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Which vocabulary `scopes` and `scopes_any_of` above are written in, declared rather than inferred. Normally omitted: Truto derives this from configuration that already exists, so every integration is classified without anyone labelling it. Set it only to correct a derivation that reads an integration wrongly."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationResourceMethodPermissionVocabulary {
#[doc = " `oauth_scope`"]
OauthScope,
#[doc = " `api_key_permission`"]
ApiKeyPermission,
#[doc = " `role_label`"]
RoleLabel,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationResourceMethodPermissionVocabulary {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::OauthScope => "oauth_scope",
Self::ApiKeyPermission => "api_key_permission",
Self::RoleLabel => "role_label",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationResourceMethodPermissionVocabulary {
fn from(s: &str) -> Self {
match s {
"oauth_scope" => Self::OauthScope,
"api_key_permission" => Self::ApiKeyPermission,
"role_label" => Self::RoleLabel,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationResourceMethodPermissionVocabulary {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationResourceMethodPermissionVocabulary {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationResourceMethodPermissionVocabulary {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationResourceMethodPermissionVocabulary {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationResourceMethodPermissionVocabulary {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " How array values are serialized in the query string. `comma` → `?a=1,2`; `brackets` → `?a[]=1&a[]=2`; `indices` → `?a[0]=1&a[1]=2`; `repeat` → `?a=1&a=2`."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationResourceMethodQueryArrayFormat {
#[doc = " `comma`"]
Comma,
#[doc = " `brackets`"]
Brackets,
#[doc = " `indices`"]
Indices,
#[doc = " `repeat`"]
Repeat,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationResourceMethodQueryArrayFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Comma => "comma",
Self::Brackets => "brackets",
Self::Indices => "indices",
Self::Repeat => "repeat",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationResourceMethodQueryArrayFormat {
fn from(s: &str) -> Self {
match s {
"comma" => Self::Comma,
"brackets" => Self::Brackets,
"indices" => Self::Indices,
"repeat" => Self::Repeat,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationResourceMethodQueryArrayFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationResourceMethodQueryArrayFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationResourceMethodQueryArrayFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationResourceMethodQueryArrayFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationResourceMethodQueryArrayFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationResponse {
#[doc = " The ID of the integration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The name of the integration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " The category of the integration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub category: Option<String>,
#[doc = " Whether the integration is in beta or not. Beta integrations might not have been tested completely and are not recommended for production environments."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_beta: Option<bool>,
#[doc = " The configuration object defining the underlying API of the integration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<IntegrationConfig>,
#[doc = " The ID of the team that owns this integration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub team_id: Option<String>,
#[doc = " The sharing policy of the integration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sharing: Option<IntegrationSchemaSharing>,
#[doc = " The date and time when the integration was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the integration was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
#[doc = " A list of environment IDs where this integration is installed."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub installed_environment: Option<Vec<String>>,
#[doc = " The team that owns this integration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub team: Option<TeamSchema>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationSchema {
#[doc = " The ID of the integration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The name of the integration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " The category of the integration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub category: Option<String>,
#[doc = " Whether the integration is in beta or not. Beta integrations might not have been tested completely and are not recommended for production environments."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_beta: Option<bool>,
#[doc = " The configuration object defining the underlying API of the integration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<IntegrationConfig>,
#[doc = " The ID of the team that owns this integration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub team_id: Option<String>,
#[doc = " The sharing policy of the integration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sharing: Option<IntegrationSchemaSharing>,
#[doc = " The date and time when the integration was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the integration was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
}
#[doc = " The sharing policy of the integration."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationSchemaSharing {
#[doc = " `allow`"]
Allow,
#[doc = " `ask`"]
Ask,
#[doc = " `deny`"]
Deny,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationSchemaSharing {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Allow => "allow",
Self::Ask => "ask",
Self::Deny => "deny",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationSchemaSharing {
fn from(s: &str) -> Self {
match s {
"allow" => Self::Allow,
"ask" => Self::Ask,
"deny" => Self::Deny,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationSchemaSharing {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationSchemaSharing {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationSchemaSharing {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationSchemaSharing {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationSchemaSharing {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationToolsResponse {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub result: Option<Vec<IntegrationToolsResponseResultItem>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationToolsResponseResultItem {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationUnifiedApisResponse {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub result: Option<Vec<IntegrationUnifiedApisResponseResultItem>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationUnifiedApisResponseResultItem {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub api_name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resources: Option<Vec<IntegrationUnifiedApisResponseResultItemResourcesItem>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationUnifiedApisResponseResultItemResourcesItem {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub docs_url: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationUpdateRequest {
#[doc = " The name of your integration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " A short descriptor or category."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub category: Option<String>,
#[doc = " The updated configuration object for the integration. See `IntegrationConfig` for the full typed shape."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<IntegrationConfig>,
#[doc = " Whether the integration is considered beta."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_beta: Option<bool>,
#[doc = " The current version of the integration. Required for concurrency control."]
pub version: f64,
}
#[doc = " HTTP Basic signature verification."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationWebhookBasicVerification {
pub format: IntegrationWebhookBasicVerificationFormat,
pub config: IntegrationWebhookBasicVerificationConfig,
}
#[doc = " HTTP Basic signature verification. Truto base64-encodes `username:password` and compares it with the second word of `compare_with` (i.e. `Authorization: Basic <token>`)."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationWebhookBasicVerificationConfig {
#[doc = " Expected username. Supports placeholders."]
pub username: String,
#[doc = " Expected password. Supports placeholders."]
pub password: String,
#[doc = " The full `Authorization` header value, e.g. `{{headers.authorization}}`."]
pub compare_with: String,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationWebhookBasicVerificationFormat {
#[doc = " `basic`"]
Basic,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationWebhookBasicVerificationFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Basic => "basic",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationWebhookBasicVerificationFormat {
fn from(s: &str) -> Self {
match s {
"basic" => Self::Basic,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationWebhookBasicVerificationFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationWebhookBasicVerificationFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationWebhookBasicVerificationFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationWebhookBasicVerificationFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationWebhookBasicVerificationFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Bearer-token signature verification."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationWebhookBearerVerification {
pub format: IntegrationWebhookBearerVerificationFormat,
pub config: IntegrationWebhookBearerVerificationConfig,
}
#[doc = " Bearer-token signature verification. Truto compares `secret` (constant-time) with the second word of `compare_with` (i.e. `Authorization: Bearer <token>`)."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationWebhookBearerVerificationConfig {
#[doc = " Expected bearer token. Supports placeholders."]
pub secret: String,
#[doc = " The full `Authorization` header value, e.g. `{{headers.authorization}}`."]
pub compare_with: String,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationWebhookBearerVerificationFormat {
#[doc = " `bearer`"]
Bearer,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationWebhookBearerVerificationFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Bearer => "bearer",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationWebhookBearerVerificationFormat {
fn from(s: &str) -> Self {
match s {
"bearer" => Self::Bearer,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationWebhookBearerVerificationFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationWebhookBearerVerificationFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationWebhookBearerVerificationFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationWebhookBearerVerificationFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationWebhookBearerVerificationFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " How Truto receives and verifies inbound webhooks for this integration. **Not** to be confused with `WebhookSchema` elsewhere in this spec, which describes Truto's _outbound_ webhook delivered to your application."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationWebhookConfig {
#[doc = " Strategy used to verify the webhook signature before accepting it. Runs **after** `payload_transform` and **after** `handle_verification` returns `{ type: 'payload' }`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub signature_verification: Option<IntegrationWebhookSignatureVerification>,
#[doc = " JSONata expression evaluated on **every** inbound webhook before signature verification. Use to: * Respond to handshake pings (return `{ type: 'verify', verification_response: { status_code, body, headers } }`). * Surface meta-events that should not fan out (return `{ type: 'meta' }`). * Update the integrated account context (return `{ type: 'verify' \\| 'payload' \\| 'meta', update_context: { ... } }`). * Pass through to fan-out (return `{ type: 'payload' }` or omit entirely — defaults to `payload`)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub handle_verification: Option<String>,
#[doc = " JSONata expression that transforms the raw inbound payload **before** `handle_verification` and `signature_verification` see it. Use to normalize vendor-specific envelopes (e.g. unwrap a Salesforce `payloads[]` array, decode a base64 body)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub payload_transform: Option<String>,
}
#[doc = " Return value from `webhook.handle_verification`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationWebhookHandleVerificationResult {
#[doc = " Branch selector — `verify` returns `verification_response` directly to the vendor; `payload` falls through to normal event handling."]
pub r#type: IntegrationWebhookHandleVerificationResultType,
#[doc = " Used when `type: \"verify\"`. Truto sends this back as the HTTP response to the vendor's handshake."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub verification_response: Option<IntegrationWebhookHandleVerificationResultVerificationResponse>,
#[doc = " Optional patch to merge into the integrated-account context after handling this verification. Useful for storing vendor-issued subscription IDs, signing secrets, etc."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub update_context: Option<Map<String, Value>>,
}
#[doc = " Branch selector — `verify` returns `verification_response` directly to the vendor; `payload` falls through to normal event handling."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationWebhookHandleVerificationResultType {
#[doc = " `verify`"]
Verify,
#[doc = " `payload`"]
Payload,
#[doc = " `meta`"]
Meta,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationWebhookHandleVerificationResultType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Verify => "verify",
Self::Payload => "payload",
Self::Meta => "meta",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationWebhookHandleVerificationResultType {
fn from(s: &str) -> Self {
match s {
"verify" => Self::Verify,
"payload" => Self::Payload,
"meta" => Self::Meta,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationWebhookHandleVerificationResultType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationWebhookHandleVerificationResultType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationWebhookHandleVerificationResultType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationWebhookHandleVerificationResultType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationWebhookHandleVerificationResultType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Used when `type: \"verify\"`. Truto sends this back as the HTTP response to the vendor's handshake."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationWebhookHandleVerificationResultVerificationResponse {
#[doc = " HTTP status code (default 200)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_code: Option<i64>,
#[doc = " Response headers."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub headers: Option<BTreeMap<String, String>>,
#[doc = " Response body (serialized as JSON unless the headers say otherwise)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body: Option<Map<String, Value>>,
}
#[doc = " HMAC signature verification. Truto computes `hmac(algorithm, secret, signed_string)` and compares it (constant-time) with `compare_with`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationWebhookHmacVerification {
pub format: IntegrationWebhookHmacVerificationFormat,
pub config: IntegrationWebhookHmacVerificationConfig,
}
#[doc = " HMAC signature verification. Truto computes `hmac(algorithm, secret, signed_string)` and compares it (constant-time) with `compare_with`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationWebhookHmacVerificationConfig {
#[doc = " Shared HMAC secret. Typically a placeholder like `{{context.webhook_secret}}` or `{{environment_variables.WEBHOOK_SECRET_secret}}`."]
pub secret: String,
#[doc = " Hashing algorithm."]
pub algorithm: String,
#[doc = " Output encoding for the computed digest."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub string_type: Option<String>,
#[doc = " The signature value from the request to compare against. Usually a placeholder like `{{headers.x-signature}}`."]
pub compare_with: String,
#[doc = " Ordered list of `IntegrationWebhookPayloadContext` field names to concatenate as the signed string (e.g. `[\"raw_body\"]` or `[\"timestamp\", \"raw_body\"]`). Mutually exclusive with `verification_content`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub parts: Option<Vec<String>>,
#[doc = " Ordered list of placeholders to concatenate as the signed string (e.g. `[\"{{headers.x-timestamp}}\", \".\", \"{{raw_body}}\"]`). Mutually exclusive with `parts`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub verification_content: Option<Vec<String>>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationWebhookHmacVerificationFormat {
#[doc = " `hmac`"]
Hmac,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationWebhookHmacVerificationFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Hmac => "hmac",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationWebhookHmacVerificationFormat {
fn from(s: &str) -> Self {
match s {
"hmac" => Self::Hmac,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationWebhookHmacVerificationFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationWebhookHmacVerificationFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationWebhookHmacVerificationFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationWebhookHmacVerificationFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationWebhookHmacVerificationFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " JWT signature verification."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationWebhookJwtVerification {
pub format: IntegrationWebhookJwtVerificationFormat,
pub config: IntegrationWebhookJwtVerificationConfig,
}
#[doc = " JWT signature verification, in one of two modes."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationWebhookJwtVerificationConfig {
#[doc = " Shared signing secret for HS256. Supports placeholders. Not used when `jwks_uri` is set."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub secret: Option<String>,
#[doc = " The JWT to verify, typically a placeholder like `{{headers.authorization}}` or `{{body.token}}`. With `jwks_uri`, an `Authorization: Bearer <jwt>` value is accepted as-is."]
pub compare_with: String,
#[doc = " HTTPS URL of the issuer's JSON Web Key Set. Setting it selects the issuer-key-set mode. Keys are cached for an hour."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub jwks_uri: Option<String>,
#[doc = " Asymmetric algorithm the token must use (`RS256`, `RS384`, `RS512`, `PS256`, `PS384`, `PS512`, `ES256`, `ES384`, `ES512` or `EdDSA`). Defaults to `RS256`. Used with `jwks_uri` only."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub algorithm: Option<String>,
#[doc = " Required `iss` claim, e.g. `https://accounts.google.com`. Used with `jwks_uri` only."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub issuer: Option<String>,
#[doc = " Required `aud` claim. Supports placeholders, e.g. `https://api.truto.one/environment-integration-webhook/{{environment_integration_id}}`. Used with `jwks_uri` only."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub audience: Option<String>,
#[doc = " Required `email` claim, e.g. the push subscription's service account. The token's `email_verified` must also be true. Used with `jwks_uri` only."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub email: Option<String>,
#[doc = " Required `sub` claim. Use instead of, or together with, `email`. Used with `jwks_uri` only."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub subject: Option<String>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationWebhookJwtVerificationFormat {
#[doc = " `jwt`"]
Jwt,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationWebhookJwtVerificationFormat {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Jwt => "jwt",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationWebhookJwtVerificationFormat {
fn from(s: &str) -> Self {
match s {
"jwt" => Self::Jwt,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationWebhookJwtVerificationFormat {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationWebhookJwtVerificationFormat {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationWebhookJwtVerificationFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationWebhookJwtVerificationFormat {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationWebhookJwtVerificationFormat {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Input passed to `webhook.handle_verification`, `webhook.payload_transform`, and the `webhook.signature_verification.config` placeholder resolver."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct IntegrationWebhookPayloadContext {
#[doc = " Parsed JSON body of the inbound webhook request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body: Option<Map<String, Value>>,
#[doc = " Raw (unparsed) request body. Required for HMAC verification of vendors that sign the exact byte stream."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub raw_body: Option<String>,
#[doc = " Lower-cased request headers."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub headers: Option<BTreeMap<String, String>>,
#[doc = " Query-string params from the webhook callback URL (e.g. Truto's signed handshake parameters)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query_params: Option<BTreeMap<String, String>>,
#[doc = " The integrated account this webhook was delivered to. Present for per-account webhook URLs."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integrated_account_id: Option<String>,
#[doc = " The environment ID resolved from the webhook URL."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[doc = " The environment-integration ID. Present for environment-level webhook URLs."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_integration_id: Option<String>,
#[doc = " `verify` for handshake/challenge requests, `payload` for real event deliveries, `meta` for Truto metadata pings."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub webhook_type: Option<IntegrationWebhookPayloadContextWebhookType>,
#[doc = " The full integrated-account context (credentials, OAuth tokens, env vars, etc.). Same shape as the request context used elsewhere."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub context: Option<IntegrationPlaceholderContext>,
}
#[doc = " `verify` for handshake/challenge requests, `payload` for real event deliveries, `meta` for Truto metadata pings."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum IntegrationWebhookPayloadContextWebhookType {
#[doc = " `verify`"]
Verify,
#[doc = " `payload`"]
Payload,
#[doc = " `meta`"]
Meta,
/// A value not known to this version of the SDK.
Other(String),
}
impl IntegrationWebhookPayloadContextWebhookType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Verify => "verify",
Self::Payload => "payload",
Self::Meta => "meta",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for IntegrationWebhookPayloadContextWebhookType {
fn from(s: &str) -> Self {
match s {
"verify" => Self::Verify,
"payload" => Self::Payload,
"meta" => Self::Meta,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for IntegrationWebhookPayloadContextWebhookType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for IntegrationWebhookPayloadContextWebhookType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for IntegrationWebhookPayloadContextWebhookType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for IntegrationWebhookPayloadContextWebhookType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for IntegrationWebhookPayloadContextWebhookType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Strategy used to verify an inbound webhook's signature. The `format` discriminator selects which `config` shape applies."]
///
/// Union type: holds the raw JSON and decodes a variant on demand.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(transparent)]
pub struct IntegrationWebhookSignatureVerification(pub Value);
impl IntegrationWebhookSignatureVerification {
/// The raw JSON value.
pub fn raw(&self) -> &Value {
&self.0
}
/// Consume the wrapper and return the raw JSON value.
pub fn into_raw(self) -> Value {
self.0
}
/// Decode the value as [`IntegrationWebhookHmacVerification`].
pub fn as_integration_webhook_hmac_verification(&self) -> Result<IntegrationWebhookHmacVerification, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`IntegrationWebhookBasicVerification`].
pub fn as_integration_webhook_basic_verification(&self) -> Result<IntegrationWebhookBasicVerification, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`IntegrationWebhookBearerVerification`].
pub fn as_integration_webhook_bearer_verification(&self) -> Result<IntegrationWebhookBearerVerification, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`IntegrationWebhookJwtVerification`].
pub fn as_integration_webhook_jwt_verification(&self) -> Result<IntegrationWebhookJwtVerification, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
}
impl From<IntegrationWebhookHmacVerification> for IntegrationWebhookSignatureVerification {
fn from(v: IntegrationWebhookHmacVerification) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<IntegrationWebhookBasicVerification> for IntegrationWebhookSignatureVerification {
fn from(v: IntegrationWebhookBasicVerification) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<IntegrationWebhookBearerVerification> for IntegrationWebhookSignatureVerification {
fn from(v: IntegrationWebhookBearerVerification) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<IntegrationWebhookJwtVerification> for IntegrationWebhookSignatureVerification {
fn from(v: IntegrationWebhookJwtVerification) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<Value> for IntegrationWebhookSignatureVerification {
fn from(v: Value) -> Self {
Self(v)
}
}
#[doc = " Top-level JSON Schema object used by Truto's unified-model resource definitions."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct JsonSchemaObject {
pub r#type: JsonSchemaObjectType,
#[serde(rename = "$ref")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#ref: Option<String>,
#[doc = " Map of property name → `JsonSchemaObjectProperties`."]
pub properties: BTreeMap<String, JsonSchemaObjectProperties>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub required: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub default: Option<Value>,
#[serde(rename = "additionalProperties")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub additional_properties: Option<bool>,
}
#[doc = " A single property entry in a JSON Schema-style declaration. Used for `query_schema`, `body_schema`, `request_body_schema`, and the inner `properties` map of `JsonSchemaObject`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct JsonSchemaObjectProperties {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#type: Option<JsonSchemaObjectPropertiesType>,
#[doc = " JSON Schema `$ref` pointer (used when this property references another schema)."]
#[serde(rename = "$ref")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#ref: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[doc = " Whether this property is required. Truto uses a boolean per-property convention rather than the standard JSON Schema `required` array."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub required: Option<bool>,
#[doc = " When `type=array`, the element schema (only `type` is enforced)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub items: Option<JsonSchemaObjectPropertiesItems>,
#[doc = " When `type=object`, the nested property map."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub properties: Option<Map<String, Value>>,
#[doc = " JSONata expression (string) or an object-form mapping describing how to project this property out of the integration response."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mapping: Option<Value>,
#[doc = " Default value used when the caller omits this field."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub default: Option<Value>,
#[doc = " Optional format hint (e.g. `date-time`, `uuid`). On a `body_schema` property, `type: string` + `format: binary` declares FILE BYTES. The rule, exactly: the property is TOP-LEVEL (or the `items` of a top-level array of files, `multipart` only; Elaichi does not send multipart arrays as files yet, which needs `noSquareBrackets: true` on the method and cardamom#30, so a single file field works today and the lint warns on an array) and is `type: string` (an untyped `{format: binary}` is not a file), and the method's effective body is `multipart` (a file part named after the property) or `raw` (the ONE property of the body, under a content type that is not a data format; an array of files is not read under `raw`). The effective body is the engine's: an unset `body_format` means `json` for a `list` method and a DELETE `delete`, and NO body for every other method, and `multipart` on list/get/delete or `raw` on get/delete is not built at all. `format: binary` on a `json`/`form`/`xml` body (or a method that sends no body) is not read as a file; a file carried as base64 text in a `json`/`form` body uses `contentEncoding` instead."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub format: Option<String>,
#[doc = " JSON Schema `contentEncoding`. On a TOP-LEVEL `type: string` property (or the `items` of a top-level array) of a `json` or `form` `body_schema`, `base64` / `base64url` (case-insensitive) declares that the string carries a file's content encoded as text (for example Microsoft Graph `contentBytes`). Elaichi reads it in `json` and `form` bodies and also as a scalar part in `multipart`; it is not read in `raw` (the body is the bytes, declared with `format: binary`) or `xml`, and a multipart ARRAY of encoded parts is deferred like an array of files. `format: byte` alone is not a file. Never combine it with `format: binary`."]
#[serde(rename = "contentEncoding")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub content_encoding: Option<String>,
#[doc = " Allowed values for the property."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#enum: Option<Vec<Value>>,
#[serde(rename = "additionalProperties")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub additional_properties: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub example: Option<String>,
#[doc = " Free-form description shown when the property is required only in certain contexts."]
#[serde(rename = "conditionallyRequiredDescription")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub conditionally_required_description: Option<String>,
#[doc = " Truto-specific cross-resource reference metadata. Either a single reference object, an array of references, or omitted entirely. Explicit `null` is also accepted to clear any inherited reference."]
#[serde(rename = "xTrutoReference")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub x_truto_reference: Option<Value>,
}
#[doc = " When `type=array`, the element schema (only `type` is enforced)."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct JsonSchemaObjectPropertiesItems {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#type: Option<JsonSchemaObjectPropertiesItemsType>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum JsonSchemaObjectPropertiesItemsType {
#[doc = " `string`"]
String,
#[doc = " `number`"]
Number,
#[doc = " `boolean`"]
Boolean,
#[doc = " `array`"]
Array,
#[doc = " `object`"]
Object,
#[doc = " `integer`"]
Integer,
/// A value not known to this version of the SDK.
Other(String),
}
impl JsonSchemaObjectPropertiesItemsType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::String => "string",
Self::Number => "number",
Self::Boolean => "boolean",
Self::Array => "array",
Self::Object => "object",
Self::Integer => "integer",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for JsonSchemaObjectPropertiesItemsType {
fn from(s: &str) -> Self {
match s {
"string" => Self::String,
"number" => Self::Number,
"boolean" => Self::Boolean,
"array" => Self::Array,
"object" => Self::Object,
"integer" => Self::Integer,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for JsonSchemaObjectPropertiesItemsType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for JsonSchemaObjectPropertiesItemsType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for JsonSchemaObjectPropertiesItemsType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for JsonSchemaObjectPropertiesItemsType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for JsonSchemaObjectPropertiesItemsType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum JsonSchemaObjectPropertiesType {
#[doc = " `string`"]
String,
#[doc = " `number`"]
Number,
#[doc = " `boolean`"]
Boolean,
#[doc = " `array`"]
Array,
#[doc = " `object`"]
Object,
#[doc = " `integer`"]
Integer,
/// A value not known to this version of the SDK.
Other(String),
}
impl JsonSchemaObjectPropertiesType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::String => "string",
Self::Number => "number",
Self::Boolean => "boolean",
Self::Array => "array",
Self::Object => "object",
Self::Integer => "integer",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for JsonSchemaObjectPropertiesType {
fn from(s: &str) -> Self {
match s {
"string" => Self::String,
"number" => Self::Number,
"boolean" => Self::Boolean,
"array" => Self::Array,
"object" => Self::Object,
"integer" => Self::Integer,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for JsonSchemaObjectPropertiesType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for JsonSchemaObjectPropertiesType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for JsonSchemaObjectPropertiesType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for JsonSchemaObjectPropertiesType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for JsonSchemaObjectPropertiesType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum JsonSchemaObjectType {
#[doc = " `object`"]
Object,
/// A value not known to this version of the SDK.
Other(String),
}
impl JsonSchemaObjectType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Object => "object",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for JsonSchemaObjectType {
fn from(s: &str) -> Self {
match s {
"object" => Self::Object,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for JsonSchemaObjectType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for JsonSchemaObjectType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for JsonSchemaObjectType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for JsonSchemaObjectType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for JsonSchemaObjectType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct LinkToken {
#[doc = " The link token that can be used to initiate a connection flow."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub link_token: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct LinkTokenRequest {
#[doc = " The ID of the tenant you want to create a link token for. Required if you are creating a link token for a new integrated account. Free-form up to 255 characters, excluding control characters, leading or trailing whitespace, and the dot segments `.` and `..`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tenant_id: Option<String>,
#[doc = " The ID of the integrated account you want to reauthorize. Do NOT specify `tenant_id` if you are reauthorizing an integrated account."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integrated_account_id: Option<String>,
#[doc = " The context of the integrated account. You can find these in the `Variables` section of an integrated account in the Truto UI."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub context: Option<Map<String, Value>>,
#[doc = " The URI where the user should be redirected after the connection flow is complete. This is especially useful when you are authenticating via a Desktop app."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub redirect_uri: Option<String>,
#[doc = " IDs of environment unified models (installed unified models) whose OAuth scopes should be used during the connection flow. When omitted, integration default scopes are used unless overridden by `scopes`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_unified_model_id: Option<Vec<String>>,
#[doc = " OAuth scopes to request during authentication. These scopes will take precedence over unified model scopes and integration default scopes."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scopes: Option<Vec<String>>,
#[doc = " If set to true, the context of the integrated account will be persisted when reconnecting. Set to false by default."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub persist_previous_context: Option<bool>,
#[doc = " The ID of the static gate to associate with this integrated account. The static gate must be one you can see. For a link token that names an `environment_id`, it must also be in an environment of that environment's team, or it's a `404`. Whatever the token, a connection only ever uses a gate of its own team, and another team's gate is ignored when its requests are made."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub truto_static_gate_id: Option<String>,
#[doc = " The region where the new integrated account will be placed. Only applies when creating a new integrated account via the link token (ignored for reauthorization)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub region: Option<LinkTokenRequestRegion>,
}
#[doc = " The region where the new integrated account will be placed. Only applies when creating a new integrated account via the link token (ignored for reauthorization)."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum LinkTokenRequestRegion {
#[doc = " `wnam`"]
Wnam,
#[doc = " `enam`"]
Enam,
#[doc = " `apac`"]
Apac,
#[doc = " `eu`"]
Eu,
/// A value not known to this version of the SDK.
Other(String),
}
impl LinkTokenRequestRegion {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Wnam => "wnam",
Self::Enam => "enam",
Self::Apac => "apac",
Self::Eu => "eu",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for LinkTokenRequestRegion {
fn from(s: &str) -> Self {
match s {
"wnam" => Self::Wnam,
"enam" => Self::Enam,
"apac" => Self::Apac,
"eu" => Self::Eu,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for LinkTokenRequestRegion {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for LinkTokenRequestRegion {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for LinkTokenRequestRegion {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for LinkTokenRequestRegion {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for LinkTokenRequestRegion {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " A single log entry returned by `GET /log`. The `log_type` field on each row matches the `log_type` query parameter that was used to fetch it, and identifies which variant schema applies. Variants share the `LogBase` fields and may carry additional fields not enumerated in the spec — clients should treat unknown fields as opaque."]
///
/// Union type: holds the raw JSON and decodes a variant on demand.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(transparent)]
pub struct Log(pub Value);
impl Log {
/// The raw JSON value.
pub fn raw(&self) -> &Value {
&self.0
}
/// Consume the wrapper and return the raw JSON value.
pub fn into_raw(self) -> Value {
self.0
}
/// Decode the value as [`UnifiedProxyApiLog`].
pub fn as_unified_proxy_api_log(&self) -> Result<UnifiedProxyApiLog, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`RapidBridgeLog`].
pub fn as_rapid_bridge_log(&self) -> Result<RapidBridgeLog, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`WebhookLog`].
pub fn as_webhook_log(&self) -> Result<WebhookLog, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`McpLog`].
pub fn as_mcp_log(&self) -> Result<McpLog, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
/// Decode the value as [`SyncJobCronTriggerLog`].
pub fn as_sync_job_cron_trigger_log(&self) -> Result<SyncJobCronTriggerLog, serde_json::Error> {
serde_json::from_value(self.0.clone())
}
}
impl From<UnifiedProxyApiLog> for Log {
fn from(v: UnifiedProxyApiLog) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<RapidBridgeLog> for Log {
fn from(v: RapidBridgeLog) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<WebhookLog> for Log {
fn from(v: WebhookLog) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<McpLog> for Log {
fn from(v: McpLog) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<SyncJobCronTriggerLog> for Log {
fn from(v: SyncJobCronTriggerLog) -> Self {
Self(serde_json::to_value(v).unwrap_or(Value::Null))
}
}
impl From<Value> for Log {
fn from(v: Value) -> Self {
Self(v)
}
}
#[doc = " Common fields present on every log entry returned by `GET /log`. Each concrete variant (e.g. `UnifiedProxyApiLog`, `WebhookLog`) extends this base with type-specific fields via `allOf`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct LogBase {
#[doc = " The time at which the log entry was recorded."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub timestamp: Option<String>,
#[doc = " Human-readable summary of the log event."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[doc = " The service that generated the log."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub service: Option<String>,
#[doc = " The deployment that wrote the log (`production`, `staging`, `staging2`, `thoropass-production`, and per-developer preview deployments). Distinct from `environment_id`, which is the Truto environment the log belongs to: a single `environment_id` can be served by more than one deployment, and `app_env` is what tells them apart. Not an enumerated set — new deployments add values."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub app_env: Option<String>,
#[doc = " The Truto environment in which the log was generated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[doc = " Discriminator. Echoed from the `log_type` query parameter so each row is self-describing. Use this to switch on variant when consuming the response programmatically."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub log_type: Option<LogBaseLogType>,
#[doc = " Internal log messages captured during request/job processing."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub logs: Option<Vec<String>>,
}
#[doc = " Discriminator. Echoed from the `log_type` query parameter so each row is self-describing. Use this to switch on variant when consuming the response programmatically."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum LogBaseLogType {
#[doc = " `unified_proxy_api`"]
UnifiedProxyApi,
#[doc = " `rapid_bridge`"]
RapidBridge,
#[doc = " `webhook`"]
Webhook,
#[doc = " `mcp`"]
Mcp,
#[doc = " `sync_job_cron_trigger`"]
SyncJobCronTrigger,
/// A value not known to this version of the SDK.
Other(String),
}
impl LogBaseLogType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::UnifiedProxyApi => "unified_proxy_api",
Self::RapidBridge => "rapid_bridge",
Self::Webhook => "webhook",
Self::Mcp => "mcp",
Self::SyncJobCronTrigger => "sync_job_cron_trigger",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for LogBaseLogType {
fn from(s: &str) -> Self {
match s {
"unified_proxy_api" => Self::UnifiedProxyApi,
"rapid_bridge" => Self::RapidBridge,
"webhook" => Self::Webhook,
"mcp" => Self::Mcp,
"sync_job_cron_trigger" => Self::SyncJobCronTrigger,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for LogBaseLogType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for LogBaseLogType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for LogBaseLogType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for LogBaseLogType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for LogBaseLogType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " An MCP server attached to an integrated account. Each integrated account can have multiple MCP servers, each with its own scoping (`config.methods` and `config.tags`), tool exposure mode, and optional expiry."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct MCP {
#[doc = " Unique identifier for the MCP server."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " Human-readable name for the MCP server."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " The integrated account this MCP server is bound to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integrated_account_id: Option<String>,
#[doc = " Optional scoping for the MCP server. When omitted, all available tools for the integrated account are exposed."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<MCPConfig>,
#[doc = " Optional expiry timestamp. When set, the MCP server's token is invalidated after this time."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expires_at: Option<String>,
#[doc = " ID of the user who created the MCP server."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_by: Option<String>,
#[doc = " Time at which the MCP server was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " Time at which the MCP server was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
}
#[doc = " Optional scoping for the MCP server. When omitted, all available tools for the integrated account are exposed."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct MCPConfig {
#[doc = " Restrict the MCP server to these Truto method names. Combined with `tags` using AND semantics."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub methods: Option<Vec<String>>,
#[doc = " Restrict the MCP server to tools whose effective tags (resource-level and optional resource.method tags) intersect these values."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<String>>,
#[doc = " How tools are exposed on `tools/list`. - `all` (default): every matching tool schema is listed. - `discovery`: only three meta-tools are listed (`search_tools`, `get_tool_schema`, `call_tool`). The client discovers and calls real tools through those."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tool_exposure: Option<MCPConfigToolExposure>,
#[doc = " When true, MCP requests also require a valid Truto API token in the Authorization Bearer header."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub require_api_token_auth: Option<bool>,
}
#[doc = " How tools are exposed on `tools/list`. - `all` (default): every matching tool schema is listed. - `discovery`: only three meta-tools are listed (`search_tools`, `get_tool_schema`, `call_tool`). The client discovers and calls real tools through those."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum MCPConfigToolExposure {
#[doc = " `all`"]
All,
#[doc = " `discovery`"]
Discovery,
/// A value not known to this version of the SDK.
Other(String),
}
impl MCPConfigToolExposure {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::All => "all",
Self::Discovery => "discovery",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for MCPConfigToolExposure {
fn from(s: &str) -> Self {
match s {
"all" => Self::All,
"discovery" => Self::Discovery,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for MCPConfigToolExposure {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for MCPConfigToolExposure {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for MCPConfigToolExposure {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for MCPConfigToolExposure {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for MCPConfigToolExposure {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Response returned by `POST /integrated-account/{integrated_account_id}/mcp`. Includes the MCP server fields, the freshly minted bearer `token`, and the full `url` to use when configuring an MCP client. The token is only returned at creation time and cannot be retrieved later."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct MCPCreateResponse {
#[doc = " Unique identifier for the MCP server."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " Human-readable name for the MCP server."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " The integrated account this MCP server is bound to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integrated_account_id: Option<String>,
#[doc = " Optional scoping for the MCP server. When omitted, all available tools for the integrated account are exposed."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<MCPConfig>,
#[doc = " Optional expiry timestamp. When set, the MCP server's token is invalidated after this time."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expires_at: Option<String>,
#[doc = " ID of the user who created the MCP server."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_by: Option<String>,
#[doc = " Time at which the MCP server was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " Time at which the MCP server was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
#[doc = " Bearer token used to authenticate MCP requests. Treat this as a secret; it is not retrievable after creation."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub token: Option<String>,
#[doc = " Full MCP endpoint URL. Configure your MCP client with this URL to connect to the server."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
}
#[doc = " Log entry produced by an MCP request handled by Truto's MCP server."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct McpLog {
#[doc = " The time at which the log entry was recorded."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub timestamp: Option<String>,
#[doc = " Human-readable summary of the log event."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[doc = " The service that generated the log."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub service: Option<String>,
#[doc = " The deployment that wrote the log (`production`, `staging`, `staging2`, `thoropass-production`, and per-developer preview deployments). Distinct from `environment_id`, which is the Truto environment the log belongs to: a single `environment_id` can be served by more than one deployment, and `app_env` is what tells them apart. Not an enumerated set — new deployments add values."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub app_env: Option<String>,
#[doc = " The Truto environment in which the log was generated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub log_type: Option<McpLogLogType>,
#[doc = " Internal log messages captured during request/job processing."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub logs: Option<Vec<String>>,
#[doc = " The hostname that served the request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub host: Option<String>,
#[doc = " The full URL of the request (with sensitive paths masked)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_url: Option<String>,
#[doc = " The HTTP status code of the response."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_status_code: Option<i64>,
#[doc = " The HTTP method of the request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_method: Option<String>,
#[doc = " The IP address of the client."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_ip: Option<String>,
#[doc = " The Cloudflare Ray ID for the request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_request_id: Option<String>,
#[doc = " The country code of the client (from Cloudflare)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_country: Option<String>,
#[doc = " The User-Agent header of the request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_useragent: Option<String>,
#[doc = " The hostname portion of the request URL."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_url_details_host: Option<String>,
#[doc = " The path portion of the request URL. On `mcp` rows the token segment is masked in full, so the value is always `/mcp/[redacted]` and identifies nothing — use `mcp_server_id` / `mcp_server_name` instead."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_url_details_path: Option<String>,
#[doc = " The parsed query string parameters of the request URL."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_url_details_query_string: Option<Map<String, Value>>,
#[doc = " The URL scheme."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_url_details_scheme: Option<String>,
#[doc = " The HTTP protocol version."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_version: Option<String>,
#[doc = " How the request was authenticated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authentication_type: Option<HttpRequestFieldsAuthenticationType>,
#[doc = " The ID of the authenticated user, if applicable."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub user_id: Option<String>,
#[doc = " The response headers returned to the client."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response_headers: Option<BTreeMap<String, String>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub request_type: Option<McpLogRequestType>,
#[doc = " Total time in milliseconds between Truto receiving the MCP request and sending the response."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub duration: Option<f64>,
#[doc = " Time in milliseconds spent fetching data from the upstream API while servicing the MCP request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub fetch_duration: Option<f64>,
#[doc = " The integrated account this MCP server is bound to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integrated_account_id: Option<String>,
#[doc = " The integration name that handled the MCP request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration: Option<String>,
#[doc = " The MCP server ID."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mcp_server_id: Option<String>,
#[doc = " The MCP server name."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mcp_server_name: Option<String>,
#[doc = " The MCP protocol method."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mcp_method: Option<McpLogMcpMethod>,
#[doc = " The name of the MCP client."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub client_name: Option<String>,
#[doc = " The version of the MCP client."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub client_version: Option<String>,
#[doc = " The MCP tool that was called (only set for `tools/call`)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tool_name: Option<String>,
#[doc = " The Truto resource backing the called tool."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource: Option<String>,
#[doc = " The Truto method backing the called tool."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub method: Option<String>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum McpLogLogType {
#[doc = " `mcp`"]
Mcp,
/// A value not known to this version of the SDK.
Other(String),
}
impl McpLogLogType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Mcp => "mcp",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for McpLogLogType {
fn from(s: &str) -> Self {
match s {
"mcp" => Self::Mcp,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for McpLogLogType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for McpLogLogType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for McpLogLogType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for McpLogLogType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for McpLogLogType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " The MCP protocol method."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum McpLogMcpMethod {
#[doc = " `initialize`"]
Initialize,
#[doc = " `notifications/initialized`"]
NotificationsInitialized,
#[doc = " `tools/list`"]
ToolsList,
#[doc = " `tools/call`"]
ToolsCall,
#[doc = " `prompts/list`"]
PromptsList,
#[doc = " `resources/list`"]
ResourcesList,
#[doc = " `ping`"]
Ping,
/// A value not known to this version of the SDK.
Other(String),
}
impl McpLogMcpMethod {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Initialize => "initialize",
Self::NotificationsInitialized => "notifications/initialized",
Self::ToolsList => "tools/list",
Self::ToolsCall => "tools/call",
Self::PromptsList => "prompts/list",
Self::ResourcesList => "resources/list",
Self::Ping => "ping",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for McpLogMcpMethod {
fn from(s: &str) -> Self {
match s {
"initialize" => Self::Initialize,
"notifications/initialized" => Self::NotificationsInitialized,
"tools/list" => Self::ToolsList,
"tools/call" => Self::ToolsCall,
"prompts/list" => Self::PromptsList,
"resources/list" => Self::ResourcesList,
"ping" => Self::Ping,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for McpLogMcpMethod {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for McpLogMcpMethod {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for McpLogMcpMethod {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for McpLogMcpMethod {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for McpLogMcpMethod {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum McpLogRequestType {
#[doc = " `mcp`"]
Mcp,
/// A value not known to this version of the SDK.
Other(String),
}
impl McpLogRequestType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Mcp => "mcp",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for McpLogRequestType {
fn from(s: &str) -> Self {
match s {
"mcp" => Self::Mcp,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for McpLogRequestType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for McpLogRequestType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for McpLogRequestType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for McpLogRequestType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for McpLogRequestType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct ObservabilityDestinationCreateRequest {
pub environment_id: String,
pub r#type: ObservabilityDestinationCreateRequestType,
pub name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_active: Option<bool>,
pub config: Map<String, Value>,
#[doc = " Secret bag stored as a single encrypted JSON blob. Use `api_key` for Datadog, `token` for Splunk HEC, `client_secret` for Microsoft Sentinel, `token` or `username` + `password` for OTLP, `api_key` or `username` + `password` for Elasticsearch, and `access_key_id` + `secret_access_key` for S3. Never returned by the API."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub secrets: Option<BTreeMap<String, String>>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ObservabilityDestinationCreateRequestType {
#[doc = " `datadog`"]
Datadog,
#[doc = " `splunk_hec`"]
SplunkHec,
#[doc = " `sentinel`"]
Sentinel,
#[doc = " `otlp`"]
Otlp,
#[doc = " `elasticsearch`"]
Elasticsearch,
#[doc = " `s3`"]
S3,
/// A value not known to this version of the SDK.
Other(String),
}
impl ObservabilityDestinationCreateRequestType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Datadog => "datadog",
Self::SplunkHec => "splunk_hec",
Self::Sentinel => "sentinel",
Self::Otlp => "otlp",
Self::Elasticsearch => "elasticsearch",
Self::S3 => "s3",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for ObservabilityDestinationCreateRequestType {
fn from(s: &str) -> Self {
match s {
"datadog" => Self::Datadog,
"splunk_hec" => Self::SplunkHec,
"sentinel" => Self::Sentinel,
"otlp" => Self::Otlp,
"elasticsearch" => Self::Elasticsearch,
"s3" => Self::S3,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for ObservabilityDestinationCreateRequestType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for ObservabilityDestinationCreateRequestType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for ObservabilityDestinationCreateRequestType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for ObservabilityDestinationCreateRequestType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for ObservabilityDestinationCreateRequestType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct ObservabilityDestinationResponse {
#[doc = " The ID of the observability destination."]
pub id: String,
#[doc = " The environment whose logs are forwarded."]
pub environment_id: String,
#[doc = " Destination type."]
pub r#type: ObservabilityDestinationResponseType,
#[doc = " Human-readable destination name."]
pub name: String,
#[doc = " Whether forwarding is enabled."]
pub is_active: bool,
#[doc = " Non-secret destination configuration. Datadog: `site`, `tags`. Splunk HEC: `hec_url`, `index`, `source`, `sourcetype`. Microsoft Sentinel: `tenant_id`, `client_id`, `dce_endpoint`, `dcr_immutable_id`, `stream_name`, `cloud`. OTLP: `endpoint`, `resource_attributes`. Elasticsearch: `url`, `index`, `pipeline`. S3: `bucket`, `region`, `endpoint` (S3-compatible storage such as GCS or R2), `prefix`. All types accept a `log_types` filter."]
pub config: Map<String, Value>,
pub created_at: String,
pub updated_at: String,
}
#[doc = " Destination type."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ObservabilityDestinationResponseType {
#[doc = " `datadog`"]
Datadog,
#[doc = " `splunk_hec`"]
SplunkHec,
#[doc = " `sentinel`"]
Sentinel,
#[doc = " `otlp`"]
Otlp,
#[doc = " `elasticsearch`"]
Elasticsearch,
#[doc = " `s3`"]
S3,
/// A value not known to this version of the SDK.
Other(String),
}
impl ObservabilityDestinationResponseType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Datadog => "datadog",
Self::SplunkHec => "splunk_hec",
Self::Sentinel => "sentinel",
Self::Otlp => "otlp",
Self::Elasticsearch => "elasticsearch",
Self::S3 => "s3",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for ObservabilityDestinationResponseType {
fn from(s: &str) -> Self {
match s {
"datadog" => Self::Datadog,
"splunk_hec" => Self::SplunkHec,
"sentinel" => Self::Sentinel,
"otlp" => Self::Otlp,
"elasticsearch" => Self::Elasticsearch,
"s3" => Self::S3,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for ObservabilityDestinationResponseType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for ObservabilityDestinationResponseType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for ObservabilityDestinationResponseType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for ObservabilityDestinationResponseType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for ObservabilityDestinationResponseType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct ObservabilityDestinationTestRequest {
#[doc = " A complete config for the destination type."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<Map<String, Value>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub secrets: Option<BTreeMap<String, String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct ObservabilityDestinationTestResponse {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ok: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status: Option<f64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct ObservabilityDestinationUpdateRequest {
#[doc = " Changing the type requires `config` and `secrets` for the new type in the same request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#type: Option<ObservabilityDestinationUpdateRequestType>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_active: Option<bool>,
#[doc = " Replaces the whole stored config when provided (fields are not merged), so it must be a complete config for the destination type. For example, a Datadog update must include `site` even when only `tags` change; a partial config is rejected with a 400."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<Map<String, Value>>,
#[doc = " Secret bag stored as a single encrypted JSON blob. Replaces the stored secrets when provided, and must include the secrets the destination type requires. Never returned by the API."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub secrets: Option<BTreeMap<String, String>>,
}
#[doc = " Changing the type requires `config` and `secrets` for the new type in the same request."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ObservabilityDestinationUpdateRequestType {
#[doc = " `datadog`"]
Datadog,
#[doc = " `splunk_hec`"]
SplunkHec,
#[doc = " `sentinel`"]
Sentinel,
#[doc = " `otlp`"]
Otlp,
#[doc = " `elasticsearch`"]
Elasticsearch,
#[doc = " `s3`"]
S3,
/// A value not known to this version of the SDK.
Other(String),
}
impl ObservabilityDestinationUpdateRequestType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Datadog => "datadog",
Self::SplunkHec => "splunk_hec",
Self::Sentinel => "sentinel",
Self::Otlp => "otlp",
Self::Elasticsearch => "elasticsearch",
Self::S3 => "s3",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for ObservabilityDestinationUpdateRequestType {
fn from(s: &str) -> Self {
match s {
"datadog" => Self::Datadog,
"splunk_hec" => Self::SplunkHec,
"sentinel" => Self::Sentinel,
"otlp" => Self::Otlp,
"elasticsearch" => Self::Elasticsearch,
"s3" => Self::S3,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for ObservabilityDestinationUpdateRequestType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for ObservabilityDestinationUpdateRequestType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for ObservabilityDestinationUpdateRequestType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for ObservabilityDestinationUpdateRequestType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for ObservabilityDestinationUpdateRequestType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " A registered WebAuthn credential, sanitized for display. Credential material (`credential_id`, `public_key`) is never returned."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct Passkey {
#[doc = " The unique ID of the passkey. Use this to rename or delete it."]
pub id: String,
#[doc = " User-supplied label, or `null` when the passkey was registered without one."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " `multiDevice` for a synced passkey (iCloud Keychain, Google Password Manager); `singleDevice` for a device-bound one (a security key, or a platform authenticator that does not sync)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub device_type: Option<String>,
#[doc = " Whether the credential is currently synced into a backup (the WebAuthn BS flag). Refreshed on every sign-in."]
pub backup_state: bool,
#[doc = " ISO-8601 UTC timestamp of the last successful sign-in with this passkey; `null` if it has never been used."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_used_at: Option<String>,
#[doc = " ISO-8601 UTC timestamp of registration."]
pub created_at: String,
}
#[doc = " A bare `PublicKeyCredentialRequestOptionsJSON` — pass it straight to `navigator.credentials.get({ publicKey })`. Note `rpId` is flat here, unlike the nested `rp` object on registration options."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct PasskeyAuthenticationOptions {
#[doc = " The environment's `APP_URL` host."]
#[serde(rename = "rpId")]
pub rp_id: String,
#[doc = " base64url challenge. Single-use, stored server-side for 5 minutes under `handle`."]
pub challenge: String,
#[doc = " Always empty — sign-in is usernameless, so the browser offers whichever discoverable credential it holds for this `rpId`. Naming credentials here would leak which accounts exist."]
#[serde(rename = "allowCredentials")]
pub allow_credentials: Vec<Map<String, Value>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub timeout: Option<f64>,
#[serde(rename = "userVerification")]
pub user_verification: PasskeyAuthenticationOptionsUserVerification,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PasskeyAuthenticationOptionsUserVerification {
#[doc = " `required`"]
Required,
/// A value not known to this version of the SDK.
Other(String),
}
impl PasskeyAuthenticationOptionsUserVerification {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Required => "required",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for PasskeyAuthenticationOptionsUserVerification {
fn from(s: &str) -> Self {
match s {
"required" => Self::Required,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for PasskeyAuthenticationOptionsUserVerification {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for PasskeyAuthenticationOptionsUserVerification {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for PasskeyAuthenticationOptionsUserVerification {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for PasskeyAuthenticationOptionsUserVerification {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for PasskeyAuthenticationOptionsUserVerification {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " The `PublicKeyCredential` returned by `navigator.credentials.get()`, JSON-serialized (base64url). Extra fields the browser adds are accepted and ignored."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct PasskeyAuthenticationResponse {
#[doc = " base64url credential ID. Max 64 KB."]
pub id: String,
#[doc = " base64url credential ID. Max 64 KB."]
#[serde(rename = "rawId")]
pub raw_id: String,
#[doc = " Always `public-key`. Max 64 characters."]
pub r#type: String,
pub response: PasskeyAuthenticationResponseResponse,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct PasskeyAuthenticationResponseResponse {
#[doc = " base64url. Max 64 KB."]
#[serde(rename = "clientDataJSON")]
pub client_data_json: String,
#[doc = " base64url. Max 64 KB."]
#[serde(rename = "authenticatorData")]
pub authenticator_data: String,
#[doc = " base64url. Max 64 KB."]
pub signature: String,
#[doc = " base64url. Max 64 KB. Ignored — the credential ID resolves the user."]
#[serde(rename = "userHandle")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub user_handle: Option<String>,
}
#[doc = " A bare `PublicKeyCredentialCreationOptionsJSON` — pass it straight to `navigator.credentials.create({ publicKey })`. Serialized by `@simplewebauthn/server`; the fields below are the ones the ceremony depends on."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct PasskeyRegistrationOptions {
#[doc = " Relying party. `id` is the environment's `APP_URL` host, so a passkey registered on one environment is never offered on another."]
pub rp: PasskeyRegistrationOptionsRp,
#[doc = " User handle the authenticator groups credentials under. `id` is the base64url-encoded Truto user id."]
pub user: PasskeyRegistrationOptionsUser,
#[doc = " base64url challenge. Single-use, stored server-side for 5 minutes."]
pub challenge: String,
#[doc = " Offered algorithms — Ed25519 (-8), ES256 (-7), RS256 (-257)."]
#[serde(rename = "pubKeyCredParams")]
pub pub_key_cred_params: Vec<PasskeyRegistrationOptionsPubKeyCredParamsItem>,
#[doc = " Browser-side ceremony timeout in milliseconds."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub timeout: Option<f64>,
#[doc = " v1 asks for no attestation."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub attestation: Option<PasskeyRegistrationOptionsAttestation>,
#[doc = " The user's existing credentials, so an authenticator they already enrolled refuses to register a duplicate."]
#[serde(rename = "excludeCredentials")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub exclude_credentials: Option<Vec<PasskeyRegistrationOptionsExcludeCredentialsItem>>,
#[doc = " `residentKey: required` because sign-in is usernameless, and `userVerification: required` so every assertion carries a second factor — which is what lets a passkey login satisfy `mfa_required`."]
#[serde(rename = "authenticatorSelection")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authenticator_selection: Option<PasskeyRegistrationOptionsAuthenticatorSelection>,
#[doc = " Client extensions the library asks for. `credProps` lets the browser report back whether the credential really was created as discoverable."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub extensions: Option<PasskeyRegistrationOptionsExtensions>,
#[doc = " Always empty — v1 gives the browser no authenticator hints."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub hints: Option<Vec<String>>,
}
#[doc = " v1 asks for no attestation."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PasskeyRegistrationOptionsAttestation {
#[doc = " `none`"]
None,
/// A value not known to this version of the SDK.
Other(String),
}
impl PasskeyRegistrationOptionsAttestation {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::None => "none",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for PasskeyRegistrationOptionsAttestation {
fn from(s: &str) -> Self {
match s {
"none" => Self::None,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for PasskeyRegistrationOptionsAttestation {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for PasskeyRegistrationOptionsAttestation {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for PasskeyRegistrationOptionsAttestation {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for PasskeyRegistrationOptionsAttestation {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for PasskeyRegistrationOptionsAttestation {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " `residentKey: required` because sign-in is usernameless, and `userVerification: required` so every assertion carries a second factor — which is what lets a passkey login satisfy `mfa_required`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct PasskeyRegistrationOptionsAuthenticatorSelection {
#[serde(rename = "residentKey")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resident_key: Option<String>,
#[serde(rename = "requireResidentKey")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub require_resident_key: Option<bool>,
#[serde(rename = "userVerification")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub user_verification: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct PasskeyRegistrationOptionsExcludeCredentialsItem {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#type: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub transports: Option<Vec<String>>,
}
#[doc = " Client extensions the library asks for. `credProps` lets the browser report back whether the credential really was created as discoverable."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct PasskeyRegistrationOptionsExtensions {
#[serde(rename = "credProps")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cred_props: Option<bool>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct PasskeyRegistrationOptionsPubKeyCredParamsItem {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub alg: Option<f64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#type: Option<String>,
}
#[doc = " Relying party. `id` is the environment's `APP_URL` host, so a passkey registered on one environment is never offered on another."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct PasskeyRegistrationOptionsRp {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[doc = " User handle the authenticator groups credentials under. `id` is the base64url-encoded Truto user id."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct PasskeyRegistrationOptionsUser {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "displayName")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
}
#[doc = " The `PublicKeyCredential` returned by `navigator.credentials.create()`, JSON-serialized (base64url). Extra fields the browser adds (`clientExtensionResults`, `authenticatorAttachment`) are accepted and ignored."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct PasskeyRegistrationResponse {
#[doc = " base64url credential ID. Max 64 KB."]
pub id: String,
#[doc = " base64url credential ID. Max 64 KB."]
#[serde(rename = "rawId")]
pub raw_id: String,
#[doc = " Always `public-key`. Max 64 characters."]
pub r#type: String,
pub response: PasskeyRegistrationResponseResponse,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct PasskeyRegistrationResponseResponse {
#[doc = " base64url. Max 64 KB."]
#[serde(rename = "clientDataJSON")]
pub client_data_json: String,
#[doc = " base64url. Max 64 KB."]
#[serde(rename = "attestationObject")]
pub attestation_object: String,
#[doc = " Transport hints reported by the authenticator. Max 16 entries of 64 characters each."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub transports: Option<Vec<String>>,
}
#[doc = " Health check response for the Truto API."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct Ping {
#[doc = " Always returns the string `pong` when the API is reachable."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
#[doc = " Log entry produced by a RapidBridge sync job run. These logs come from Durable Objects that drive sync jobs (rather than from inbound HTTP requests)."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct RapidBridgeLog {
#[doc = " The time at which the log entry was recorded."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub timestamp: Option<String>,
#[doc = " Human-readable summary of the log event."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[doc = " The service that generated the log."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub service: Option<String>,
#[doc = " The deployment that wrote the log (`production`, `staging`, `staging2`, `thoropass-production`, and per-developer preview deployments). Distinct from `environment_id`, which is the Truto environment the log belongs to: a single `environment_id` can be served by more than one deployment, and `app_env` is what tells them apart. Not an enumerated set — new deployments add values."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub app_env: Option<String>,
#[doc = " The Truto environment in which the log was generated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub log_type: Option<RapidBridgeLogLogType>,
#[doc = " Internal log messages captured during request/job processing."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub logs: Option<Vec<String>>,
#[doc = " The Durable Object class that emitted the log."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub durable_object: Option<RapidBridgeLogDurableObject>,
#[doc = " The integrated account the sync job is running against."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integrated_account_id: Option<String>,
#[doc = " The integration the sync job is running against."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration: Option<String>,
#[doc = " The sync job that was triggered."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sync_job_id: Option<String>,
#[doc = " The specific sync job run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sync_job_run_id: Option<String>,
#[doc = " The lifecycle event being logged for the sync job run. This is the field that carries run outcome on this log type — there is no `status` field on these rows."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sync_job_run_event: Option<String>,
#[doc = " The sync-job runtime version that produced the run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub version: Option<i64>,
#[doc = " The resource this sync step fetched or transformed."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource: Option<String>,
#[doc = " Ambiguous by design — this stream is written by two loggers. On a row emitted by the Durable Object's own logger (the `fetch` entrypoint) this is the **HTTP verb** the object was invoked with (`PUT`, `DELETE`). On a per-request row (the bulk of the stream) it is the **Truto method** executed by that sync step (`list`, `get`, `create`, ...), and is paired with `resource`. Rows emitted by the alarm entrypoint carry no `method` at all."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub method: Option<String>,
#[doc = " The number of records produced by this sync step."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub num_records: Option<i64>,
#[doc = " Time in milliseconds spent fetching data from the upstream API for this sync step."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub fetch_duration: Option<f64>,
#[doc = " When the sync job was triggered by a webhook, the originating webhook ID."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub webhook_id: Option<String>,
#[doc = " The HTTP status code returned when the sync job posted to its configured webhook. Unrelated to the outcome of the run itself."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub webhook_status: Option<i64>,
}
#[doc = " The Durable Object class that emitted the log."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum RapidBridgeLogDurableObject {
#[doc = " `sync_job_run`"]
SyncJobRun,
/// A value not known to this version of the SDK.
Other(String),
}
impl RapidBridgeLogDurableObject {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::SyncJobRun => "sync_job_run",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for RapidBridgeLogDurableObject {
fn from(s: &str) -> Self {
match s {
"sync_job_run" => Self::SyncJobRun,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for RapidBridgeLogDurableObject {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for RapidBridgeLogDurableObject {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for RapidBridgeLogDurableObject {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for RapidBridgeLogDurableObject {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for RapidBridgeLogDurableObject {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum RapidBridgeLogLogType {
#[doc = " `rapid_bridge`"]
RapidBridge,
/// A value not known to this version of the SDK.
Other(String),
}
impl RapidBridgeLogLogType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::RapidBridge => "rapid_bridge",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for RapidBridgeLogLogType {
fn from(s: &str) -> Self {
match s {
"rapid_bridge" => Self::RapidBridge,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for RapidBridgeLogLogType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for RapidBridgeLogLogType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for RapidBridgeLogLogType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for RapidBridgeLogLogType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for RapidBridgeLogLogType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " The body Truto returns when a **third-party API** refused the call, rather than Truto itself. Identified by `truto_is_remote_error`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct RemoteErrorResponseSchema {
#[serde(rename = "statusCode")]
pub status_code: i64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[doc = " The human text pulled out of the provider's own error body."]
pub message: String,
#[doc = " `true` when the third-party API produced this error. When absent or `false`, Truto rejected the request before it left the edge."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub truto_is_remote_error: Option<bool>,
#[doc = " The integration's error body, verbatim and uninterpreted. An object for a JSON body, a string for a plain-text or HTML one. Present on every remote error."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub raw_response: Option<Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub truto_error_insight: Option<TrutoErrorInsightSchema>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct ScimGroupResponse {
#[doc = " The ID of the SCIM group."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The ID of the team that owns this SCIM group."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub team_id: Option<String>,
#[doc = " The group's identifier in the upstream identity provider."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub external_id: Option<String>,
#[doc = " The human-readable name of the group, as pushed by the IdP."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
#[doc = " Number of users currently in this group."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub member_count: Option<f64>,
#[doc = " The date and time when the group was first provisioned."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the group was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct ScimTokenResponse {
#[doc = " The ID of the SCIM token."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The ID of the team that owns this SCIM token."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub team_id: Option<String>,
#[doc = " A descriptive name for the SCIM token."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " The ID of the user who created this token."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_by: Option<String>,
#[doc = " The date and time the IdP last authenticated against /scim/v2 with this token. Null if never used."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_used_at: Option<String>,
#[doc = " The date and time when the token was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the token was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SessionTokenDeleteRequest {
#[doc = " The tenant whose sessions should be revoked."]
pub tenant_id: String,
#[doc = " The environment to revoke in. Required for user-session auth. Defaults to the API token's own environment for API-token auth."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SessionTokenDeleteResponse {
#[doc = " How many live sessions were revoked. Zero when the tenant had none."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub revoked_count: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SessionTokenMeResponse {
#[doc = " Which kind of credential this is. `tenant` is a session token minted by `POST /session-token` — the credential this resource is named for. `api_token` is an admin API key, and `session` is a signed-in dashboard user, neither of which is a session token in the sense used here. An integrated-account token never appears: it cannot reach this route at all (see the `403` below)."]
pub r#type: SessionTokenMeResponseType,
#[doc = " The subject the credential resolves to — the tenant id when `type` is `tenant`, otherwise the API token id or the user id."]
pub id: String,
#[doc = " Session tokens only. What this session is confined to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scope: Option<SessionTokenMeResponseScope>,
#[doc = " Session tokens only. When the session was minted."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub issued_at: Option<String>,
#[doc = " Session tokens only. Moves forward on every renewal."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expires_at: Option<String>,
#[doc = " Session tokens only. Fixed at mint time."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub max_lifetime_at: Option<String>,
#[doc = " Session tokens only. Whether `POST /session-token/renew` will work."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_refreshable: Option<bool>,
#[doc = " Session tokens only. The credential that minted this session."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub issuer: Option<SessionTokenMeResponseIssuer>,
#[doc = " Session tokens only. How many origins govern this session. The list itself is never returned. Zero means nothing may frame the widget."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub allowed_origins_count: Option<i64>,
#[doc = " Session tokens only. The name of the team that owns the environment — what the connect flow falls back to when the Link UI has no `brand_name`, so the widget can name the same party when it tells an end user who to contact."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub team_name: Option<String>,
#[doc = " Session tokens only. The environment's resolved connections configuration — the same answer every server-side gate uses."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub capabilities: Option<SessionTokenMeResponseCapabilities>,
#[doc = " Session tokens only. The environment's presentation defaults for the catalog. Not a security boundary — the SDK may override them per embed and the end user may change them in the widget's own toolbar — but they belong to the environment, so they arrive with the session rather than being guessed client-side."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub layout: Option<SessionTokenMeResponseLayout>,
}
#[doc = " Session tokens only. The environment's resolved connections configuration — the same answer every server-side gate uses."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SessionTokenMeResponseCapabilities {
#[doc = " Whether the widget may start a new connection."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub allow_connect: Option<bool>,
#[doc = " Whether the widget may reconnect an existing account."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub allow_reauth: Option<bool>,
#[doc = " Whether the widget may refresh an account's credentials."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub allow_refresh: Option<bool>,
#[doc = " Whether the widget may remove a connection."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub allow_delete: Option<bool>,
#[doc = " Whether one tenant may hold more than one account per integration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub allow_multiple_per_integration: Option<bool>,
#[doc = " Whether raw upstream error details are included in the widget's connection reads."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub show_error_details: Option<bool>,
#[doc = " Whether the widget may reopen an existing connection's post-connect form via `POST /integrated-account/form-token`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub allow_configure: Option<bool>,
}
#[doc = " Session tokens only. The credential that minted this session."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SessionTokenMeResponseIssuer {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#type: Option<SessionTokenMeResponseIssuerType>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SessionTokenMeResponseIssuerType {
#[doc = " `api_token`"]
ApiToken,
#[doc = " `session`"]
Session,
/// A value not known to this version of the SDK.
Other(String),
}
impl SessionTokenMeResponseIssuerType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::ApiToken => "api_token",
Self::Session => "session",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for SessionTokenMeResponseIssuerType {
fn from(s: &str) -> Self {
match s {
"api_token" => Self::ApiToken,
"session" => Self::Session,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for SessionTokenMeResponseIssuerType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for SessionTokenMeResponseIssuerType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for SessionTokenMeResponseIssuerType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for SessionTokenMeResponseIssuerType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for SessionTokenMeResponseIssuerType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Session tokens only. The environment's presentation defaults for the catalog. Not a security boundary — the SDK may override them per embed and the end user may change them in the widget's own toolbar — but they belong to the environment, so they arrive with the session rather than being guessed client-side."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SessionTokenMeResponseLayout {
#[doc = " Which catalog layout the widget opens in."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub default_view: Option<SessionTokenMeResponseLayoutDefaultView>,
#[doc = " How the catalog is grouped when it opens."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub default_group_by: Option<SessionTokenMeResponseLayoutDefaultGroupBy>,
#[doc = " Whether the catalog's search box is shown. A catalog small enough not to need it hides the toolbar anyway."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub show_search: Option<bool>,
}
#[doc = " How the catalog is grouped when it opens."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SessionTokenMeResponseLayoutDefaultGroupBy {
#[doc = " `none`"]
None,
#[doc = " `category`"]
Category,
#[doc = " `status`"]
Status,
/// A value not known to this version of the SDK.
Other(String),
}
impl SessionTokenMeResponseLayoutDefaultGroupBy {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::None => "none",
Self::Category => "category",
Self::Status => "status",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for SessionTokenMeResponseLayoutDefaultGroupBy {
fn from(s: &str) -> Self {
match s {
"none" => Self::None,
"category" => Self::Category,
"status" => Self::Status,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for SessionTokenMeResponseLayoutDefaultGroupBy {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for SessionTokenMeResponseLayoutDefaultGroupBy {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for SessionTokenMeResponseLayoutDefaultGroupBy {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for SessionTokenMeResponseLayoutDefaultGroupBy {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for SessionTokenMeResponseLayoutDefaultGroupBy {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Which catalog layout the widget opens in."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SessionTokenMeResponseLayoutDefaultView {
#[doc = " `cards`"]
Cards,
#[doc = " `list`"]
List,
/// A value not known to this version of the SDK.
Other(String),
}
impl SessionTokenMeResponseLayoutDefaultView {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Cards => "cards",
Self::List => "list",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for SessionTokenMeResponseLayoutDefaultView {
fn from(s: &str) -> Self {
match s {
"cards" => Self::Cards,
"list" => Self::List,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for SessionTokenMeResponseLayoutDefaultView {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for SessionTokenMeResponseLayoutDefaultView {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for SessionTokenMeResponseLayoutDefaultView {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for SessionTokenMeResponseLayoutDefaultView {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for SessionTokenMeResponseLayoutDefaultView {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Session tokens only. What this session is confined to."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SessionTokenMeResponseScope {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tenant_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
}
#[doc = " Which kind of credential this is. `tenant` is a session token minted by `POST /session-token` — the credential this resource is named for. `api_token` is an admin API key, and `session` is a signed-in dashboard user, neither of which is a session token in the sense used here. An integrated-account token never appears: it cannot reach this route at all (see the `403` below)."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SessionTokenMeResponseType {
#[doc = " `tenant`"]
Tenant,
#[doc = " `api_token`"]
ApiToken,
#[doc = " `session`"]
Session,
/// A value not known to this version of the SDK.
Other(String),
}
impl SessionTokenMeResponseType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Tenant => "tenant",
Self::ApiToken => "api_token",
Self::Session => "session",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for SessionTokenMeResponseType {
fn from(s: &str) -> Self {
match s {
"tenant" => Self::Tenant,
"api_token" => Self::ApiToken,
"session" => Self::Session,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for SessionTokenMeResponseType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for SessionTokenMeResponseType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for SessionTokenMeResponseType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for SessionTokenMeResponseType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for SessionTokenMeResponseType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SessionTokenRenewResponse {
#[doc = " The same secret that was sent in. Renewal does not rotate it."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub session_token: Option<String>,
#[doc = " The new expiry."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expires_at: Option<String>,
#[doc = " Unchanged from when the session was minted."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub max_lifetime_at: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SessionTokenRequest {
#[doc = " The tenant this session is scoped to. The tenant must already exist in the environment unless `create_tenant_if_missing` is true."]
pub tenant_id: String,
#[doc = " The environment the tenant belongs to. Required for user-session auth. Defaults to the API token's own environment for API-token auth."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[doc = " Seconds until the token expires. Clamped to `max_lifetime` when that is smaller."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expires_in: Option<i64>,
#[doc = " Whether `POST /session-token/renew` may slide this token forward. A non-refreshable session must be re-minted instead."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_refreshable: Option<bool>,
#[doc = " Seconds from issue until the absolute ceiling on this session. Renewal can never extend past it."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub max_lifetime: Option<i64>,
#[doc = " Narrows the environment's allowed origins for this session only. Intersected with the environment's list — entries it does not already allow are dropped. Omit to inherit the environment's list."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub allowed_origins: Option<Vec<String>>,
#[doc = " Create the tenant when it does not exist yet, instead of failing with `404`. Useful for first-run customers whose tenant row has not materialized."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub create_tenant_if_missing: Option<bool>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SessionTokenResponse {
#[doc = " The session token. Send it in the `Authorization` header as a bearer token."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub session_token: Option<String>,
#[doc = " When this token stops authenticating unless it is renewed."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expires_at: Option<String>,
#[doc = " The absolute ceiling. No renewal can carry the session past this."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub max_lifetime_at: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SsoConnectionResponse {
#[doc = " The ID of the SSO connection."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The ID of the team that owns this SSO connection."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub team_id: Option<String>,
#[doc = " The SSO protocol used by this connection."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub protocol: Option<SsoConnectionResponseProtocol>,
#[doc = " Whether this SSO connection is active."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_active: Option<bool>,
#[doc = " Whether SSO login is enforced for users on the connection's verified domains."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub enforced: Option<bool>,
#[doc = " Whether this is the team's default SSO connection."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_default: Option<bool>,
#[doc = " Non-secret protocol settings. Secret values (the OIDC client secret and SAML SP keys) are never returned."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<SsoConnectionResponseConfig>,
#[doc = " The role assigned to users provisioned through this connection."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub default_role: Option<String>,
#[doc = " Environment IDs that provisioned users are granted access to by default."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub default_environment_ids: Option<Vec<String>>,
#[doc = " The date and time when the SSO connection was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the SSO connection was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
}
#[doc = " Non-secret protocol settings. Secret values (the OIDC client secret and SAML SP keys) are never returned."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SsoConnectionResponseConfig {
#[doc = " SAML IdP entity ID."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub idp_entity_id: Option<String>,
#[doc = " SAML IdP single sign-on URL."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub idp_sso_url: Option<String>,
#[doc = " SAML IdP X.509 signing certificate (PEM)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub idp_x509_cert: Option<String>,
#[doc = " OIDC issuer URL."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub issuer: Option<String>,
#[doc = " OIDC relying-party client ID."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub client_id: Option<String>,
#[doc = " OIDC discovery document URL."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub discovery_url: Option<String>,
#[doc = " SAML only — sign SP-initiated AuthnRequests with the SP key (HTTP-Redirect binding)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sign_authn_requests: Option<bool>,
#[doc = " SAML only — accept unsolicited (IdP-initiated) responses at the ACS. Defaults to false (unsolicited responses rejected) when omitted."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub allow_idp_initiated: Option<bool>,
}
#[doc = " The SSO protocol used by this connection."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SsoConnectionResponseProtocol {
#[doc = " `saml`"]
Saml,
#[doc = " `oidc`"]
Oidc,
/// A value not known to this version of the SDK.
Other(String),
}
impl SsoConnectionResponseProtocol {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Saml => "saml",
Self::Oidc => "oidc",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for SsoConnectionResponseProtocol {
fn from(s: &str) -> Self {
match s {
"saml" => Self::Saml,
"oidc" => Self::Oidc,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for SsoConnectionResponseProtocol {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for SsoConnectionResponseProtocol {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for SsoConnectionResponseProtocol {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for SsoConnectionResponseProtocol {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for SsoConnectionResponseProtocol {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SsoDomainResponse {
#[doc = " The ID of the team that owns this domain."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub team_id: Option<String>,
#[doc = " The email domain associated with the SSO connection."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub domain: Option<String>,
#[doc = " The ID of the SSO connection this domain belongs to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sso_connection_id: Option<String>,
#[doc = " Whether this domain has been verified via the DNS TXT challenge."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub verified: Option<bool>,
#[doc = " The DNS TXT challenge token. Publish a TXT record `truto-domain-verification=<verification_token>` on the domain, then call the verify endpoint."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub verification_token: Option<String>,
#[doc = " The date and time when the domain was added."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the domain was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct StaticGateCreateRequest {
#[doc = " A descriptive name for the static gate."]
pub name: String,
#[doc = " The domain this static gate will proxy requests for."]
pub domain: String,
#[doc = " The ID of the environment this static gate will be scoped to."]
pub environment_id: String,
#[doc = " Optional API token secret. If not provided, one will be generated automatically."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub api_token_secret: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct StaticGateCreateResponse {
#[doc = " The ID of the static gate."]
pub id: String,
#[doc = " A descriptive name for the static gate."]
pub name: String,
#[doc = " The domain this static gate will proxy requests for."]
pub domain: String,
#[doc = " The ID of the user who created this static gate."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_by: Option<String>,
#[doc = " The ID of the environment this static gate is scoped to."]
pub environment_id: String,
#[doc = " The date and time when the static gate was created."]
pub created_at: String,
#[doc = " The date and time when the static gate was last updated."]
pub updated_at: String,
#[doc = " The generated API token for this static gate."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub api_token: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct StaticGateResponse {
#[doc = " The ID of the static gate."]
pub id: String,
#[doc = " A descriptive name for the static gate."]
pub name: String,
#[doc = " The domain this static gate will proxy requests for."]
pub domain: String,
#[doc = " The ID of the user who created this static gate."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_by: Option<String>,
#[doc = " The ID of the environment this static gate is scoped to."]
pub environment_id: String,
#[doc = " The date and time when the static gate was created."]
pub created_at: String,
#[doc = " The date and time when the static gate was last updated."]
pub updated_at: String,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct StaticGateUpdateRequest {
#[doc = " A descriptive name for the static gate."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " The domain this static gate will proxy requests for."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub domain: Option<String>,
}
#[doc = " Top-level JSON Schema object used by Truto's unified-model resource definitions."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SyncJobArgsSchemaSchema {
pub r#type: JsonSchemaObjectType,
#[serde(rename = "$ref")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#ref: Option<String>,
#[doc = " Map of property name → `JsonSchemaObjectProperties`."]
pub properties: BTreeMap<String, JsonSchemaObjectProperties>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub required: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub default: Option<Value>,
#[serde(rename = "additionalProperties")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub additional_properties: Option<bool>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SyncJobCreateRequest {
#[doc = " The name of the integration that this sync job interacts with."]
pub integration_name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub args_schema: Option<SyncJobArgsSchemaSchema>,
pub resources: Vec<SyncJobResourceSchema>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SyncJobCronTriggerCreateRequest {
#[doc = " The ID of the sync job to run."]
pub sync_job_id: String,
#[doc = " The arguments passed to the sync job run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub args: Option<Map<String, Value>>,
#[doc = " The ID of the integrated account that this sync job run belongs to."]
pub integrated_account_id: String,
#[doc = " The name of the daemon group that this sync job run should be assigned to. Used while creating a sync job run. Truto find a daemon in the group that is available to run the sync job. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub daemon_group_key: Option<String>,
#[doc = " The ID of the webhook where the sync job records need to be sent. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub webhook_id: Option<String>,
#[doc = " The cron expression that defines when the sync job should be run. The timezone used is UTC. Runs must be at least 5 minutes apart. When the trigger is saved, the gap between its next two runs is checked."]
pub cron_expression: String,
}
#[doc = " Log entry produced when a sync job's cron alarm fires (one row per scheduled sync trigger). The Alarm Durable Object delivers the tick as an inbound `POST /alarm`, so these rows also carry the HTTP fields of that internal call — `http_status_code` reflects whether Truto accepted the tick, not anything about the upstream integration."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SyncJobCronTriggerLog {
#[doc = " The time at which the log entry was recorded."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub timestamp: Option<String>,
#[doc = " Human-readable summary of the log event."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[doc = " The service that generated the log."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub service: Option<String>,
#[doc = " The deployment that wrote the log (`production`, `staging`, `staging2`, `thoropass-production`, and per-developer preview deployments). Distinct from `environment_id`, which is the Truto environment the log belongs to: a single `environment_id` can be served by more than one deployment, and `app_env` is what tells them apart. Not an enumerated set — new deployments add values."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub app_env: Option<String>,
#[doc = " The Truto environment in which the log was generated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub log_type: Option<SyncJobCronTriggerLogLogType>,
#[doc = " Internal log messages captured during request/job processing."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub logs: Option<Vec<String>>,
#[doc = " The alarm classifier emitted by the underlying Durable Object."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub alarm_type: Option<SyncJobCronTriggerLogAlarmType>,
#[doc = " The sync job cron trigger whose alarm fired."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub entity_id: Option<String>,
#[doc = " The status Truto returned for the internal alarm delivery. `200` means the tick was accepted and a sync job run was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_status_code: Option<i64>,
#[doc = " The HTTP method of the internal alarm delivery. Always `POST`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_method: Option<String>,
#[doc = " Time in milliseconds Truto spent handling the alarm tick."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub duration: Option<f64>,
}
#[doc = " The alarm classifier emitted by the underlying Durable Object."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SyncJobCronTriggerLogAlarmType {
#[doc = " `sync_job_cron_trigger`"]
SyncJobCronTrigger,
/// A value not known to this version of the SDK.
Other(String),
}
impl SyncJobCronTriggerLogAlarmType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::SyncJobCronTrigger => "sync_job_cron_trigger",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for SyncJobCronTriggerLogAlarmType {
fn from(s: &str) -> Self {
match s {
"sync_job_cron_trigger" => Self::SyncJobCronTrigger,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for SyncJobCronTriggerLogAlarmType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for SyncJobCronTriggerLogAlarmType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for SyncJobCronTriggerLogAlarmType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for SyncJobCronTriggerLogAlarmType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for SyncJobCronTriggerLogAlarmType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SyncJobCronTriggerLogLogType {
#[doc = " `sync_job_cron_trigger`"]
SyncJobCronTrigger,
/// A value not known to this version of the SDK.
Other(String),
}
impl SyncJobCronTriggerLogLogType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::SyncJobCronTrigger => "sync_job_cron_trigger",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for SyncJobCronTriggerLogLogType {
fn from(s: &str) -> Self {
match s {
"sync_job_cron_trigger" => Self::SyncJobCronTrigger,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for SyncJobCronTriggerLogLogType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for SyncJobCronTriggerLogLogType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for SyncJobCronTriggerLogLogType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for SyncJobCronTriggerLogLogType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for SyncJobCronTriggerLogLogType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SyncJobCronTriggerSchema {
#[doc = " The ID of the sync job cron trigger."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The arguments passed to the sync job cron trigger."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub args: Option<Map<String, Value>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resources: Option<Vec<SyncJobResourceSchema>>,
#[doc = " The cron expression defining when the sync job should run, in UTC."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cron_expression: Option<String>,
#[doc = " The ID of the sync job that this sync job cron trigger should run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sync_job_id: Option<String>,
#[doc = " The ID of the integrated account that this sync job cron trigger should run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integrated_account_id: Option<String>,
#[doc = " The name of the daemon group that this sync job run should be assigned to. Used while creating a sync job run. Truto find a daemon in the group that is available to run the sync job. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub daemon_group_key: Option<String>,
#[doc = " The ID of the webhook where the sync job records need to be sent. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub webhook_id: Option<String>,
#[doc = " The date and time when the sync job run was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the sync job run was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SyncJobCronTriggerUpdateRequest {
#[doc = " The name of the daemon group that this sync job run should be assigned to. Used while creating a sync job run. Truto find a daemon in the group that is available to run the sync job. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub daemon_group_key: Option<String>,
#[doc = " The ID of the webhook where the sync job records need to be sent. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub webhook_id: Option<String>,
#[doc = " The cron expression that defines when the sync job should be run. The timezone used is UTC. A new value must have runs at least 5 minutes apart; the gap between its next two runs is checked. Sending the value the trigger already has is not checked again."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cron_expression: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SyncJobResourceSchema {
#[doc = " The name of the resource to sync. For Unified APIs, it should be in the format `unified_api_name/resource_name`. For Proxy API, it can just be `resource_name`."]
pub resource: String,
#[doc = " The method to call on the resource."]
pub method: String,
#[doc = " The ID of the resource to sync. This is optional and can be used to sync a single resource. It also supports placeholders."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The query parameters to pass to the resource method. It supports placeholders for values."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query: Option<Map<String, Value>>,
#[doc = " When a particular placeholder argument is an array and you want to repeat the request for each element in that array, you can set this parameter. For example, if you accept an argument called `user_ids` which is an array of strings, and you want to fetch each user's details, you can set this parameter to `user_ids` and the request will be repeated for each element in the `user_ids` array."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub loop_on: Option<String>,
#[doc = " The resource that this resource depends on (parent resource). This is optional and can be used to sync a resource only after another resource has been synced. Each object synced for the parent resource is available as the resources object in placeholders for the child resource, e.g. `{{resources.crm.contacts.id}}` if depends on is `crm/contacts` resource."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub depends_on: Option<String>,
#[doc = " Whether to persist the resource in the database or not in case of a Daemon sync job run or send as a payload in case of RapidBridge sync job run. The Proxy API resources are by default NOT persisted and this parameter can be set to `true` to persist them. Unified API resources are always persisted."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub persist: Option<bool>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SyncJobRunCreateRequest {
#[doc = " The ID of the sync job to run."]
pub sync_job_id: String,
#[doc = " The arguments passed to the sync job run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub args: Option<Map<String, Value>>,
#[doc = " The ID of the integrated account that this sync job run belongs to."]
pub integrated_account_id: String,
#[doc = " The name of the daemon group that this sync job run should be assigned to. Used while creating a sync job run. Truto find a daemon in the group that is available to run the sync job. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub daemon_group_key: Option<String>,
#[doc = " The ID of the webhook where the sync job records need to be sent. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub webhook_id: Option<String>,
#[doc = " Specify how to handle errors while running the sync job. `fail_fast` - stop the sync job run as soon as an error is encountered, `ignore` - continue running the sync job run even if an error is encountered. In case of `ignore`, you'll receive `sync_job_run:record_error` events for each error encountered. In case of `batch`, you'll receive `sync_job_run:record_error` events with multiple errors batched into the errors array, this is only supported when the `version` used for Sync Job Run is 2. By default, `ignore` is used."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error_handling: Option<SyncJobRunCreateRequestErrorHandling>,
#[doc = " If your Sync Job uses `previous_run_date` placeholder for incremental sync, you can choose to ignore the previous run and run a full sync instead by setting this parameter to `true`. By default, `false` is used."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ignore_previous_run: Option<bool>,
}
#[doc = " Specify how to handle errors while running the sync job. `fail_fast` - stop the sync job run as soon as an error is encountered, `ignore` - continue running the sync job run even if an error is encountered. In case of `ignore`, you'll receive `sync_job_run:record_error` events for each error encountered. In case of `batch`, you'll receive `sync_job_run:record_error` events with multiple errors batched into the errors array, this is only supported when the `version` used for Sync Job Run is 2. By default, `ignore` is used."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SyncJobRunCreateRequestErrorHandling {
#[doc = " `fail_fast`"]
FailFast,
#[doc = " `ignore`"]
Ignore,
#[doc = " `batch`"]
Batch,
/// A value not known to this version of the SDK.
Other(String),
}
impl SyncJobRunCreateRequestErrorHandling {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::FailFast => "fail_fast",
Self::Ignore => "ignore",
Self::Batch => "batch",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for SyncJobRunCreateRequestErrorHandling {
fn from(s: &str) -> Self {
match s {
"fail_fast" => Self::FailFast,
"ignore" => Self::Ignore,
"batch" => Self::Batch,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for SyncJobRunCreateRequestErrorHandling {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for SyncJobRunCreateRequestErrorHandling {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for SyncJobRunCreateRequestErrorHandling {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for SyncJobRunCreateRequestErrorHandling {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for SyncJobRunCreateRequestErrorHandling {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Per-resource, per-method counters describing how much data the sync job moved. The outer keys are resource names (matching the `resources[].name` field of the sync job), the inner keys are the integration method invoked (`list`, `get`, etc.). Updated approximately every 10 seconds while the sync job run is in flight."]
pub type SyncJobRunResourceStats = BTreeMap<String, BTreeMap<String, SyncJobRunResourceStatsValueValue>>;
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SyncJobRunResourceStatsValueValue {
#[doc = " Number of records pulled from the upstream integration."]
pub fetched: i64,
#[doc = " Number of records actually written to the destination (datastore, super-query, or webhook)."]
pub persisted: i64,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SyncJobRunResponse {
#[doc = " The ID of the sync job run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The arguments passed to the sync job run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub args: Option<Map<String, Value>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resources: Option<Vec<SyncJobResourceSchema>>,
#[doc = " The ID of the sync job that this sync job run belongs to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sync_job_id: Option<String>,
#[doc = " The ID of the integrated account that this sync job run belongs to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integrated_account_id: Option<String>,
#[doc = " The status of the sync job run. `created` - waiting to run, `running` - running, `rate_limited` - temporarily paused after an upstream rate-limit response and will resume automatically after backoff, `completed` - completed successfully, `failed` - failed, `stopped` - stopped by the user."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status: Option<SyncJobRunSchemaStatus>,
#[doc = " The daemon_id attribute of a daemon that is running this sync job."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub daemon_id: Option<String>,
#[doc = " The name of the daemon group that this sync job run should be assigned to. Used while creating a sync job run. Truto find a daemon in the group that is available to run the sync job. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub daemon_group_key: Option<String>,
#[doc = " The ID of the webhook where the sync job records need to be sent. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub webhook_id: Option<String>,
#[doc = " Specifies the error handling strategy used for the sync job run. `fail_fast` - stop the sync job run as soon as an error is encountered, `ignore` - continue running the sync job run even if an error is encountered. In case of `ignore`, you'll receive `sync_job_run:record_error` events for each error encountered. In case of `batch`, you'll receive `sync_job_run:record_error` events with multiple errors batched into the errors array, this is only supported when the `version` used for Sync Job Run is 2."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error_handling: Option<SyncJobRunSchemaErrorHandling>,
#[doc = " Specifies if the sync job run was started ignoring the previous run date."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ignore_previous_run: Option<bool>,
#[doc = " The runtime version of the sync job run. The version 1 is the default version and the version 2 is the new version which supports batch error handling and other enhancements."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub version: Option<i64>,
#[doc = " The statistics of the resources synced in the sync job run. This will have information around how many records were fetched and persisted by the sync job run -- grouped by the resource and method. The data is updated every 10 seconds while the sync job run is running."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource_stats: Option<SyncJobRunResourceStats>,
#[doc = " The date and time when the sync job run was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the sync job run was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
#[doc = " The date and time when the sync job run was started."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub started_at: Option<String>,
#[doc = " The date and time when the sync job run was finished."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub finished_at: Option<String>,
#[doc = " The sync job that this sync job run belongs to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sync_job: Option<SyncJobSchema>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SyncJobRunSchema {
#[doc = " The ID of the sync job run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The arguments passed to the sync job run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub args: Option<Map<String, Value>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resources: Option<Vec<SyncJobResourceSchema>>,
#[doc = " The ID of the sync job that this sync job run belongs to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sync_job_id: Option<String>,
#[doc = " The ID of the integrated account that this sync job run belongs to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integrated_account_id: Option<String>,
#[doc = " The status of the sync job run. `created` - waiting to run, `running` - running, `rate_limited` - temporarily paused after an upstream rate-limit response and will resume automatically after backoff, `completed` - completed successfully, `failed` - failed, `stopped` - stopped by the user."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status: Option<SyncJobRunSchemaStatus>,
#[doc = " The daemon_id attribute of a daemon that is running this sync job."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub daemon_id: Option<String>,
#[doc = " The name of the daemon group that this sync job run should be assigned to. Used while creating a sync job run. Truto find a daemon in the group that is available to run the sync job. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub daemon_group_key: Option<String>,
#[doc = " The ID of the webhook where the sync job records need to be sent. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub webhook_id: Option<String>,
#[doc = " Specifies the error handling strategy used for the sync job run. `fail_fast` - stop the sync job run as soon as an error is encountered, `ignore` - continue running the sync job run even if an error is encountered. In case of `ignore`, you'll receive `sync_job_run:record_error` events for each error encountered. In case of `batch`, you'll receive `sync_job_run:record_error` events with multiple errors batched into the errors array, this is only supported when the `version` used for Sync Job Run is 2."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error_handling: Option<SyncJobRunSchemaErrorHandling>,
#[doc = " Specifies if the sync job run was started ignoring the previous run date."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ignore_previous_run: Option<bool>,
#[doc = " The runtime version of the sync job run. The version 1 is the default version and the version 2 is the new version which supports batch error handling and other enhancements."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub version: Option<i64>,
#[doc = " The statistics of the resources synced in the sync job run. This will have information around how many records were fetched and persisted by the sync job run -- grouped by the resource and method. The data is updated every 10 seconds while the sync job run is running."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource_stats: Option<SyncJobRunResourceStats>,
#[doc = " The date and time when the sync job run was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the sync job run was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
#[doc = " The date and time when the sync job run was started."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub started_at: Option<String>,
#[doc = " The date and time when the sync job run was finished."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub finished_at: Option<String>,
}
#[doc = " Specifies the error handling strategy used for the sync job run. `fail_fast` - stop the sync job run as soon as an error is encountered, `ignore` - continue running the sync job run even if an error is encountered. In case of `ignore`, you'll receive `sync_job_run:record_error` events for each error encountered. In case of `batch`, you'll receive `sync_job_run:record_error` events with multiple errors batched into the errors array, this is only supported when the `version` used for Sync Job Run is 2."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SyncJobRunSchemaErrorHandling {
#[doc = " `fail_fast`"]
FailFast,
#[doc = " `ignore`"]
Ignore,
#[doc = " `batch`"]
Batch,
/// A value not known to this version of the SDK.
Other(String),
}
impl SyncJobRunSchemaErrorHandling {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::FailFast => "fail_fast",
Self::Ignore => "ignore",
Self::Batch => "batch",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for SyncJobRunSchemaErrorHandling {
fn from(s: &str) -> Self {
match s {
"fail_fast" => Self::FailFast,
"ignore" => Self::Ignore,
"batch" => Self::Batch,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for SyncJobRunSchemaErrorHandling {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for SyncJobRunSchemaErrorHandling {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for SyncJobRunSchemaErrorHandling {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for SyncJobRunSchemaErrorHandling {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for SyncJobRunSchemaErrorHandling {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " The status of the sync job run. `created` - waiting to run, `running` - running, `rate_limited` - temporarily paused after an upstream rate-limit response and will resume automatically after backoff, `completed` - completed successfully, `failed` - failed, `stopped` - stopped by the user."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SyncJobRunSchemaStatus {
#[doc = " `created`"]
Created,
#[doc = " `running`"]
Running,
#[doc = " `rate_limited`"]
RateLimited,
#[doc = " `completed`"]
Completed,
#[doc = " `failed`"]
Failed,
#[doc = " `stopped`"]
Stopped,
/// A value not known to this version of the SDK.
Other(String),
}
impl SyncJobRunSchemaStatus {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Created => "created",
Self::Running => "running",
Self::RateLimited => "rate_limited",
Self::Completed => "completed",
Self::Failed => "failed",
Self::Stopped => "stopped",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for SyncJobRunSchemaStatus {
fn from(s: &str) -> Self {
match s {
"created" => Self::Created,
"running" => Self::Running,
"rate_limited" => Self::RateLimited,
"completed" => Self::Completed,
"failed" => Self::Failed,
"stopped" => Self::Stopped,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for SyncJobRunSchemaStatus {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for SyncJobRunSchemaStatus {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for SyncJobRunSchemaStatus {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for SyncJobRunSchemaStatus {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for SyncJobRunSchemaStatus {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " A key/value entry stored within a sync job's state namespace. Sync jobs use this to persist incremental cursors, dedupe markers, and other small bits of state across runs."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SyncJobRunState {
#[doc = " Key for this state entry. Unique within the namespace identified by `state_key`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[doc = " The stored value. Encode structured data (for example, JSON) as a string before storing."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
#[doc = " The ID of the sync job run that wrote this entry, if any."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sync_job_run_id: Option<String>,
#[doc = " Time at which the state entry was first created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " Time at which the state entry was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SyncJobRunStateCreateRequest {
#[doc = " The key identifier for this state."]
pub key: String,
#[doc = " The state value to store."]
pub value: String,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SyncJobRunStateListResponse {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub result: Option<Vec<SyncJobRunState>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SyncJobRunStateUpdateRequest {
#[doc = " The new state value to store."]
pub value: String,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SyncJobSchema {
#[doc = " The ID of the sync job."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The name of the integration that this sync job interacts with."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration_name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub args_schema: Option<SyncJobArgsSchemaSchema>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resources: Option<Vec<SyncJobResourceSchema>>,
#[doc = " The ID of the environment that this sync job belongs to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[doc = " The date and time when the sync job was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the sync job was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SyncJobTemplateCreate {
#[doc = " The integration name for the template."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration_name: Option<String>,
#[doc = " A JSON Schema object, or a JSON string of one. An empty array is stored as `{}`; any other array, or a string that isn't valid JSON, is a `400`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub args_schema: Option<SyncJobArgsSchemaSchema>,
#[doc = " The resources, as an array or a JSON string of one. A string that isn't a valid JSON array of resources is a `400`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resources: Option<Vec<SyncJobResourceSchema>>,
#[doc = " The default runtime version for sync jobs using this template."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub default_runtime_version: Option<f64>,
#[doc = " A short descriptor for this template that helps in idnetifying the template better"]
pub label: String,
#[doc = " Optional longer description of what this template does."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sharing: Option<SyncJobTemplateCreateSharing>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SyncJobTemplateCreateSharing {
#[doc = " `allow`"]
Allow,
#[doc = " `ask`"]
Ask,
#[doc = " `deny`"]
Deny,
/// A value not known to this version of the SDK.
Other(String),
}
impl SyncJobTemplateCreateSharing {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Allow => "allow",
Self::Ask => "ask",
Self::Deny => "deny",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for SyncJobTemplateCreateSharing {
fn from(s: &str) -> Self {
match s {
"allow" => Self::Allow,
"ask" => Self::Ask,
"deny" => Self::Deny,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for SyncJobTemplateCreateSharing {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for SyncJobTemplateCreateSharing {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for SyncJobTemplateCreateSharing {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for SyncJobTemplateCreateSharing {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for SyncJobTemplateCreateSharing {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SyncJobTemplateDeleteResponse {
#[doc = " The ID of the deleted template."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SyncJobTemplatePatch {
#[doc = " If you want to change the integration for the template."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration_name: Option<String>,
#[doc = " A JSON Schema object, or a JSON string of one. An empty array is stored as `{}`; any other array, or a string that isn't valid JSON, is a `400`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub args_schema: Option<SyncJobArgsSchemaSchema>,
#[doc = " The resources, as an array or a JSON string of one. A string that isn't a valid JSON array of resources is a `400`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resources: Option<Vec<SyncJobResourceSchema>>,
#[doc = " Timestamp automatically updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
#[doc = " The default runtime version for sync jobs using this template."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub default_runtime_version: Option<f64>,
#[doc = " A short descriptor for the template."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
#[doc = " Optional longer description of what this template does."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sharing: Option<SyncJobTemplatePatchSharing>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SyncJobTemplatePatchSharing {
#[doc = " `allow`"]
Allow,
#[doc = " `ask`"]
Ask,
#[doc = " `deny`"]
Deny,
/// A value not known to this version of the SDK.
Other(String),
}
impl SyncJobTemplatePatchSharing {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Allow => "allow",
Self::Ask => "ask",
Self::Deny => "deny",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for SyncJobTemplatePatchSharing {
fn from(s: &str) -> Self {
match s {
"allow" => Self::Allow,
"ask" => Self::Ask,
"deny" => Self::Deny,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for SyncJobTemplatePatchSharing {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for SyncJobTemplatePatchSharing {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for SyncJobTemplatePatchSharing {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for SyncJobTemplatePatchSharing {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for SyncJobTemplatePatchSharing {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SyncJobTemplateSchema {
#[doc = " The unique ID of the sync job template."]
pub id: String,
#[doc = " The integration name to which this template applies. Is null for default_runtime_version > 4."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration_name: Option<String>,
#[doc = " A short descriptor for the template."]
pub label: String,
#[doc = " Optional longer description of what this template does."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[doc = " Optional JSON schema describing arguments for the sync job."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub args_schema: Option<SyncJobArgsSchemaSchema>,
#[doc = " A list of sync job resources that define the steps. If empty, no default resources are set."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resources: Option<Vec<SyncJobResourceSchema>>,
#[doc = " The runtime version for any sync job that uses this template."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub default_runtime_version: Option<f64>,
#[doc = " The team that owns this template."]
pub team_id: String,
#[doc = " The sharing policy of the template."]
pub sharing: SyncJobTemplateSchemaSharing,
#[doc = " When the template was created."]
pub created_at: String,
#[doc = " When the template was last updated."]
pub updated_at: String,
}
#[doc = " The sharing policy of the template."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SyncJobTemplateSchemaSharing {
#[doc = " `allow`"]
Allow,
#[doc = " `ask`"]
Ask,
#[doc = " `deny`"]
Deny,
/// A value not known to this version of the SDK.
Other(String),
}
impl SyncJobTemplateSchemaSharing {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Allow => "allow",
Self::Ask => "ask",
Self::Deny => "deny",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for SyncJobTemplateSchemaSharing {
fn from(s: &str) -> Self {
match s {
"allow" => Self::Allow,
"ask" => Self::Ask,
"deny" => Self::Deny,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for SyncJobTemplateSchemaSharing {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for SyncJobTemplateSchemaSharing {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for SyncJobTemplateSchemaSharing {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for SyncJobTemplateSchemaSharing {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for SyncJobTemplateSchemaSharing {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SyncJobUpdateRequest {
#[doc = " The name of the integration that this sync job interacts with."]
pub integration_name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub args_schema: Option<SyncJobArgsSchemaSchema>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resources: Option<Vec<SyncJobResourceSchema>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct TeamSchema {
#[doc = " The ID of the team."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The name of the team."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " The domain of the team."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub domain: Option<String>,
#[doc = " The URL of the team's logo."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub logo: Option<String>,
#[doc = " Whether the team is verified or not."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_verified: Option<bool>,
#[doc = " Whether the team is white-labeled or not."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_white_label: Option<bool>,
#[doc = " A link to the team's Terms of Service, if available."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tos_link: Option<String>,
#[doc = " Whether the team allows impersonation."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub allow_impersonation: Option<bool>,
#[doc = " The date and time when the team was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the team was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct TenantBulkCreateResponse {
#[doc = " The tenants that were newly inserted."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created: Option<Vec<TenantResponse>>,
#[doc = " Tenants that already existed and were updated. Only populated when `mode` is `upsert`; always empty for `insert`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated: Option<Vec<TenantResponse>>,
#[doc = " Rows that were not inserted because a tenant with the same `(id, environment_id)` already existed. Only populated when `mode` is `insert` (the default), which uses `INSERT ... ON CONFLICT DO NOTHING`. Empty for `upsert`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub skipped: Option<Vec<TenantBulkCreateResponseSkippedItem>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct TenantBulkCreateResponseSkippedItem {
#[doc = " The tenant `id` that was skipped."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " Why the row was skipped."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub reason: Option<TenantBulkCreateResponseSkippedItemReason>,
}
#[doc = " Why the row was skipped."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum TenantBulkCreateResponseSkippedItemReason {
#[doc = " `already_exists`"]
AlreadyExists,
/// A value not known to this version of the SDK.
Other(String),
}
impl TenantBulkCreateResponseSkippedItemReason {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::AlreadyExists => "already_exists",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for TenantBulkCreateResponseSkippedItemReason {
fn from(s: &str) -> Self {
match s {
"already_exists" => Self::AlreadyExists,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for TenantBulkCreateResponseSkippedItemReason {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for TenantBulkCreateResponseSkippedItemReason {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for TenantBulkCreateResponseSkippedItemReason {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for TenantBulkCreateResponseSkippedItemReason {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for TenantBulkCreateResponseSkippedItemReason {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct TenantBulkRequest {
#[doc = " Collision behaviour. `insert` skips existing ids; `upsert` updates `name`/`metadata` on existing ids."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mode: Option<TenantBulkRequestMode>,
#[doc = " The list of tenants to create or upsert. Max 1000 per request — split larger inputs client-side. Only `id`, `name`, and `metadata` are allowed per item."]
pub tenants: Vec<TenantBulkRequestTenantsItem>,
#[doc = " Environment to create the tenants in. Required for session auth; ignored for API tokens. Applied to every row in the batch — the endpoint does not let you mix environments in one request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
}
#[doc = " Collision behaviour. `insert` skips existing ids; `upsert` updates `name`/`metadata` on existing ids."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum TenantBulkRequestMode {
#[doc = " `insert`"]
Insert,
#[doc = " `upsert`"]
Upsert,
/// A value not known to this version of the SDK.
Other(String),
}
impl TenantBulkRequestMode {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Insert => "insert",
Self::Upsert => "upsert",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for TenantBulkRequestMode {
fn from(s: &str) -> Self {
match s {
"insert" => Self::Insert,
"upsert" => Self::Upsert,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for TenantBulkRequestMode {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for TenantBulkRequestMode {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for TenantBulkRequestMode {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for TenantBulkRequestMode {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for TenantBulkRequestMode {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct TenantBulkRequestTenantsItem {
#[doc = " Tenant id. Free-form up to 255 characters, excluding control characters, leading or trailing whitespace, and the dot segments `.` and `..`."]
pub id: String,
#[doc = " Display name. Defaults to `id` when omitted on insert; kept unchanged when omitted on upsert of an existing row."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " Free-form JSON object. Defaults to `{}` when omitted on insert; kept unchanged when omitted on upsert of an existing row."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub metadata: Option<Map<String, Value>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct TenantCreateRequest {
#[doc = " Your identifier for the tenant. Free-form up to 255 characters — `/`, spaces and non-ASCII are all fine. Control characters, leading or trailing whitespace, and the dot segments `.` and `..` are rejected. Immutable — cannot be changed later."]
pub id: String,
#[doc = " Display name. Defaults to `id` when omitted."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " Free-form JSON object. Stored and returned verbatim."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub metadata: Option<Map<String, Value>>,
#[doc = " Which environment to create the tenant in. Required for session auth; ignored for API tokens (inferred from the token)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct TenantResponse {
#[doc = " The tenant identifier — caller-chosen and immutable once created. Composite primary key with `environment_id`, so the same value can exist independently in `development`, `staging`, and `production`. Free-form up to 255 characters: whatever you already use to identify a customer, including `/`, spaces and non-ASCII. The only values rejected are the ones no URL path segment can carry — control characters, leading or trailing whitespace, and the dot segments `.` and `..`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The environment this tenant belongs to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[doc = " Display name shown in the dashboard. Defaults to the tenant `id` on create if not supplied; can be edited later via `PATCH /tenant/{id}`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " Free-form JSON object stored verbatim. Truto does not interpret this field — use it for tier, region, billing plan, or any other customer attribute your app cares about."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub metadata: Option<Map<String, Value>>,
#[doc = " The date and time when the tenant was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the tenant was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct TenantUpdateRequest {
#[doc = " New display name."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " Full replacement of the metadata object."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub metadata: Option<Map<String, Value>>,
}
#[doc = " A closed predicate over `tenant.metadata`, evaluated **server-side** on the catalog list and again on connect. The rule itself is never sent to the browser, and a tenant that fails it cannot tell the integration from one that is not installed — connect answers `404`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct TenantVisibility {
#[doc = " Every condition must hold."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub all_of: Option<Vec<TenantVisibilityCondition>>,
#[doc = " At least one condition must hold."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub any_of: Option<Vec<TenantVisibilityCondition>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct TenantVisibilityCondition {
#[doc = " A dotted path into `tenant.metadata`, at most four segments deep."]
pub path: String,
pub op: TenantVisibilityConditionOp,
#[doc = " Required for `in` and `not_in`; rejected for `exists` and `not_exists`. Values are compared as strings — a numeric or boolean metadata value matches its string form."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub values: Option<Vec<String>>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum TenantVisibilityConditionOp {
#[doc = " `in`"]
In,
#[doc = " `not_in`"]
NotIn,
#[doc = " `exists`"]
Exists,
#[doc = " `not_exists`"]
NotExists,
/// A value not known to this version of the SDK.
Other(String),
}
impl TenantVisibilityConditionOp {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::In => "in",
Self::NotIn => "not_in",
Self::Exists => "exists",
Self::NotExists => "not_exists",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for TenantVisibilityConditionOp {
fn from(s: &str) -> Self {
match s {
"in" => Self::In,
"not_in" => Self::NotIn,
"exists" => Self::Exists,
"not_exists" => Self::NotExists,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for TenantVisibilityConditionOp {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for TenantVisibilityConditionOp {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for TenantVisibilityConditionOp {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for TenantVisibilityConditionOp {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for TenantVisibilityConditionOp {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct ToolSchema {
#[doc = " The resource type for the tool"]
pub resource: String,
#[doc = " The HTTP method for the tool"]
pub method: String,
#[doc = " MCP tool name for this method. Resolved as: environment-integration `tool_name` documentation override, then integration-level `tool_name` override, then a programmatic default from `getToolName()`. Overrides are stored as `documentation` rows with `type: tool_name` (max 64 chars, `[a-z0-9_]`)."]
pub name: String,
#[doc = " A description of what the tool does"]
pub description: String,
pub query_schema: ToolSchemaQuerySchema,
pub body_schema: ToolSchemaBodySchema,
pub required: Vec<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct ToolSchemaBodySchema {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#type: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub properties: Option<Map<String, Value>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct ToolSchemaQuerySchema {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#type: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub properties: Option<Map<String, Value>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct ToolsResponseSchema {
pub results: Vec<ToolSchema>,
}
#[doc = " The `truto_error_insight` object on an error response body. Every key is optional and which ones appear depends on the failure; see the Errors guide for the full list. The Proxy API has no unified schema to compare a request against, so only `forbidden_error` is added there."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct TrutoErrorInsightSchema {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub forbidden_error: Option<ForbiddenErrorInsightSchema>,
}
#[doc = " Response from `GET /unified/{model_name}/{resource_name}/{integration_name}/meta/{method}`. Returns the merged JSON schema, default query/body, and documentation link for a single integration mapping. Useful for inspecting what a unified call will accept and return without touching a real integrated account."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct UnifiedApiMetaResponse {
#[doc = " The unified method this metadata describes."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub method: Option<String>,
#[doc = " The unified-model resource JSON schema."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub schema: Option<JsonSchemaObject>,
#[doc = " Vendor documentation URL for this method, if set on the integration mapping."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub documentation_link: Option<String>,
#[doc = " A subset of `schema` containing only the fields actually populated by `response_mapping` for this integration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response_schema: Option<JsonSchemaObject>,
#[doc = " JSON-schema-style description of the supported query parameters for this method."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query_schema: Option<JsonSchemaObject>,
#[doc = " JSON-schema-style description of the supported request body for this method."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub request_body_schema: Option<JsonSchemaObject>,
#[doc = " Default query parameters always applied by the integration mapping. Values may be templated JSONata expressions."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub default_query: Option<Map<String, Value>>,
#[doc = " Default request body always applied by the integration mapping. Values may be templated JSONata expressions. Object or `null` (arrays are allowed at runtime but rare)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub default_body: Option<Map<String, Value>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct UnifiedMetaGetResponse {
#[doc = " The list of pricing plans for which the integration is available. In free text format, ready to be displayed as it is."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pricing_plan: Option<Vec<String>>,
#[doc = " The list of user roles who can connect the integration. In free text format, ready to be displayed as it is."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub user_role: Option<Vec<String>>,
#[doc = " The list of scopes required to make the unified API work."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scopes: Option<Vec<String>>,
#[doc = " The integration specific instructions like steps to create an API key, getting account subdomain, etc. In Markdown format."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub instructions: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct UnifiedModelCreateRequest {
#[doc = " The new name of the unified model, if you want to rename it."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " The new category, if you want to change it."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub category: Option<String>,
#[doc = " A brief description of what this unified model represents."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[doc = " Map of resource name → `UnifiedModelResource`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resources: Option<BTreeMap<String, UnifiedModelResource>>,
#[doc = " The ID of the team that owns this unified model."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub team_id: Option<String>,
#[doc = " Per-resource documentation (`pricing_plan`, `user_role`, `scopes`, `instructions`)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub docs: Option<BTreeMap<String, UnifiedModelResourceDocs>>,
#[doc = " Per-resource OAuth/permission scopes required to call its methods."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scopes: Option<BTreeMap<String, Vec<String>>>,
#[doc = " Per-resource webhook routing expression (JSONata)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub webhooks: Option<BTreeMap<String, String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct UnifiedModelDeleteResponse {
#[doc = " The ID of the deleted unified model."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
}
#[doc = " One element of the array form of `method` overrides. Used to dispatch to different integration methods based on a query/body discriminator."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct UnifiedModelMethod {
#[doc = " Integration method name (`list`, `get`, `create`, `update`, `delete`, or a custom method)."]
pub method: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query_param_value: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query_param: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body_field: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body_field_value: Option<String>,
}
#[doc = " A file-upload strategy that only applies when `query_param` matches `query_param_value`. Used in arrays to select different upload strategies based on caller intent."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct UnifiedModelMethodConditionalFileUpload {
pub file_upload: UnifiedModelMethodConditionalFileUploadFileUpload,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<Map<String, Value>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query_param_value: Option<String>,
pub query_param: String,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum UnifiedModelMethodConditionalFileUploadFileUpload {
#[doc = " `multipart`"]
Multipart,
#[doc = " `base64`"]
Base64,
#[doc = " `upload`"]
Upload,
/// A value not known to this version of the SDK.
Other(String),
}
impl UnifiedModelMethodConditionalFileUploadFileUpload {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Multipart => "multipart",
Self::Base64 => "base64",
Self::Upload => "upload",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for UnifiedModelMethodConditionalFileUploadFileUpload {
fn from(s: &str) -> Self {
match s {
"multipart" => Self::Multipart,
"base64" => Self::Base64,
"upload" => Self::Upload,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for UnifiedModelMethodConditionalFileUploadFileUpload {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for UnifiedModelMethodConditionalFileUploadFileUpload {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for UnifiedModelMethodConditionalFileUploadFileUpload {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for UnifiedModelMethodConditionalFileUploadFileUpload {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for UnifiedModelMethodConditionalFileUploadFileUpload {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " File-upload strategy for `create`/`update` methods."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct UnifiedModelMethodFileUpload {
pub file_upload: UnifiedModelMethodFileUploadFileUpload,
#[doc = " Strategy-specific options (e.g. multipart field name, base64 wrapper key)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<Map<String, Value>>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum UnifiedModelMethodFileUploadFileUpload {
#[doc = " `multipart`"]
Multipart,
#[doc = " `base64`"]
Base64,
#[doc = " `upload`"]
Upload,
/// A value not known to this version of the SDK.
Other(String),
}
impl UnifiedModelMethodFileUploadFileUpload {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Multipart => "multipart",
Self::Base64 => "base64",
Self::Upload => "upload",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for UnifiedModelMethodFileUploadFileUpload {
fn from(s: &str) -> Self {
match s {
"multipart" => Self::Multipart,
"base64" => Self::Base64,
"upload" => Self::Upload,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for UnifiedModelMethodFileUploadFileUpload {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for UnifiedModelMethodFileUploadFileUpload {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for UnifiedModelMethodFileUploadFileUpload {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for UnifiedModelMethodFileUploadFileUpload {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for UnifiedModelMethodFileUploadFileUpload {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " A related-resource fetch that runs after the main unified call and merges its response back in."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct UnifiedModelRelatedResources {
#[doc = " Optional name for the sub-fetch result, referenceable from `response_mapping` via `{{related.<name>}}`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " Integration resource to call (e.g. `users`)."]
pub resource: String,
#[doc = " Integration method (`list`, `get`, etc.)."]
pub method: String,
#[doc = " Query parameters to send. Values may be JSONata expressions referencing the parent record."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query: Option<Map<String, Value>>,
#[doc = " Single-record fetch: the ID to look up. Supports JSONata placeholders like `{{record.assignee_id}}`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " Extra static fields merged into the related record before `response_mapping` runs."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub additional_data: Option<BTreeMap<String, String>>,
#[doc = " Field in the parent record whose value identifies the related record(s)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub related_on: Option<String>,
#[doc = " Either a list of fields by which to relate, or `true` to use all fields."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub related_by: Option<Value>,
#[doc = " When true, replace the parent record with the related one instead of nesting."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub replace_root: Option<bool>,
#[doc = " JSONata expression; if it evaluates to falsy the sub-fetch is skipped."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub run_if: Option<String>,
#[doc = " Upstream HTTP status codes that should be rethrown instead of swallowed for this related-resource fetch."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub throw_on_error_status_codes: Option<Vec<f64>>,
}
#[doc = " Definition of a single resource (e.g. `users`) inside a unified model."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct UnifiedModelResource {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
pub schema: JsonSchemaObject,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration_mapping: Option<UnifiedModelResourceIntegrationMapping>,
#[doc = " Optional normalization expressions keyed by field name."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub normalization: Option<Map<String, Value>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub deprecated: Option<bool>,
#[doc = " Per-method metadata (e.g. deprecation flags)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub methods: Option<BTreeMap<String, UnifiedModelResourceMethods>>,
}
#[doc = " Per-integration documentation surfaced via `GET /unified/.../meta/{method}`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct UnifiedModelResourceDocs {
#[doc = " List of vendor pricing plans on which this integration mapping is supported."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pricing_plan: Option<Vec<String>>,
#[doc = " List of vendor user roles required for this integration mapping to work."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub user_role: Option<Vec<String>>,
#[doc = " OAuth/API key scopes required for this integration mapping."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scopes: Option<Vec<String>>,
#[doc = " Markdown-formatted integration-specific setup instructions."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub instructions: Option<String>,
}
#[doc = " Per-integration mapping table for a unified-model resource. Top-level keys are integration names; each value contains the per-method mapping."]
pub type UnifiedModelResourceIntegrationMapping = Map<String, Value>;
#[doc = " A single integration mapping for a unified-model method (e.g. `crm.contacts.list` on `salesforce`)."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct UnifiedModelResourceMethod {
#[doc = " Static value returned for this method without making an HTTP call."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#static: Option<Value>,
#[doc = " Integration resource to call. May be a single name, an array of resource fragments, or a `{ expression, resources }` object for dynamic dispatch."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource: Option<Value>,
#[doc = " Integration method to call."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub method: Option<Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub base_url_mapping: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub path_mapping: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error_mapping: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mapping_version: Option<f64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response_mapping_method: Option<UnifiedModelResourceMethodResponseMappingMethod>,
#[doc = " JSONata expression (string) or object-form mapping. The object form is keyed by field name with values that may be JSONata strings, nested objects, or `JsonSchemaObjectProperties`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response_mapping: Option<Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub documentation_link: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub related_resources: Option<Value>,
#[doc = " Object-form (v2) request body schema; values are partial JSON Schema entries."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub request_body_schema: Option<BTreeMap<String, JsonSchemaObjectProperties>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub request_body_mapping: Option<Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query_mapping: Option<Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query_schema: Option<Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub request_header_mapping: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response_header_mapping: Option<String>,
#[doc = " Static query params merged into the integration request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query: Option<Map<String, Value>>,
#[doc = " Static body merged into the integration request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body: Option<Map<String, Value>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub before: Option<Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub after: Option<Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_partial_response: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_partial_expression: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub side_load: Option<BTreeMap<String, EnvironmentUnifiedModelSideLoad>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub file_upload: Option<Value>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct UnifiedModelResourceMethodCreateRequest {
#[doc = " The base unified model to attach the mapping to. Must belong to one of your teams."]
pub unified_model_id: String,
#[doc = " The unified resource name (e.g. `contacts`)."]
pub resource_name: String,
#[doc = " The integration slug (e.g. `apollo`)."]
pub integration_name: String,
#[doc = " The unified method name (`list`, `get`, `create`, `update`, `delete`, or a custom method)."]
pub method_name: String,
#[doc = " The mapping configuration for this method."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<UnifiedModelResourceMethod>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct UnifiedModelResourceMethodDeleteResponse {
#[doc = " The ID of the deleted mapping row."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
}
#[doc = " One element of the array form of `resource` overrides. Used to merge multiple integration resources into a single unified call (e.g. fetching from `users` for some IDs and `contacts` for others)."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct UnifiedModelResourceMethodResource {
#[doc = " The integration resource name to call."]
pub resource: String,
#[doc = " Match value compared against `query_param`. When equal, this resource fragment is selected."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query_param_value: Option<String>,
#[doc = " Query parameter on the unified call used to discriminate between fragments."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query_param: Option<String>,
#[doc = " Body field on the unified call used to discriminate between fragments."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body_field: Option<String>,
#[doc = " Match value compared against `body_field`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body_field_value: Option<String>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum UnifiedModelResourceMethodResponseMappingMethod {
#[doc = " `array`"]
Array,
#[doc = " `item`"]
Item,
/// A value not known to this version of the SDK.
Other(String),
}
impl UnifiedModelResourceMethodResponseMappingMethod {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Array => "array",
Self::Item => "item",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for UnifiedModelResourceMethodResponseMappingMethod {
fn from(s: &str) -> Self {
match s {
"array" => Self::Array,
"item" => Self::Item,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for UnifiedModelResourceMethodResponseMappingMethod {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for UnifiedModelResourceMethodResponseMappingMethod {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for UnifiedModelResourceMethodResponseMappingMethod {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for UnifiedModelResourceMethodResponseMappingMethod {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for UnifiedModelResourceMethodResponseMappingMethod {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " One row of the `unified_model_resource_method` table — the per-integration, per-resource, per-method mapping for a **base** unified model. This is the team-wide definition every environment inherits from."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct UnifiedModelResourceMethodRowResponse {
#[doc = " The ID of the resource-method mapping row."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The base unified model this mapping belongs to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub unified_model_id: Option<String>,
#[doc = " The unified resource this mapping serves (e.g. `contacts`)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource_name: Option<String>,
#[doc = " The integration slug this mapping serves (e.g. `apollo`)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration_name: Option<String>,
#[doc = " The unified method this mapping serves (`list`, `get`, `create`, `update`, `delete`, or a custom method name)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub method_name: Option<String>,
#[doc = " The mapping itself (JSONata expressions, resource/method routing, side loads, …)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<UnifiedModelResourceMethod>,
#[doc = " Optimistic-concurrency version. Send the current value in a PATCH body; every write increments it."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub version: Option<f64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct UnifiedModelResourceMethodUpdateRequest {
#[doc = " Move the mapping to a different unified resource."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource_name: Option<String>,
#[doc = " Move the mapping to a different integration slug."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration_name: Option<String>,
#[doc = " Move the mapping to a different unified method."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub method_name: Option<String>,
#[doc = " The replacement mapping configuration."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<UnifiedModelResourceMethod>,
#[doc = " The row's current version. Required to avoid clobbering a concurrent write."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub version: Option<f64>,
}
#[doc = " Resource-level method metadata."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct UnifiedModelResourceMethods {
#[doc = " When true, marks the method as deprecated in docs/tools."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub deprecated: Option<bool>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct UnifiedModelResponse {
#[doc = " The ID of the unified model."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The name of the unified model."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " The category of the unified model."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub category: Option<String>,
#[doc = " A brief description of what this unified model represents."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[doc = " The ID of the team that owns this unified model."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub team_id: Option<String>,
#[doc = " The sharing policy of the unified model."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sharing: Option<UnifiedModelResponseSharing>,
#[doc = " Map of resource name (e.g. `users`, `contacts`) → resource definition (`UnifiedModelResource`)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resources: Option<BTreeMap<String, UnifiedModelResource>>,
#[doc = " Per-resource documentation (pricing plan / scopes / instructions)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub docs: Option<BTreeMap<String, UnifiedModelResourceDocs>>,
#[doc = " Per-resource OAuth/permission scopes required to call its methods."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scopes: Option<BTreeMap<String, Vec<String>>>,
#[doc = " Per-resource webhook routing expression (JSONata that decides whether an inbound webhook should be delivered to this resource)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub webhooks: Option<BTreeMap<String, String>>,
#[doc = " The date and time when the unified model was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the unified model was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
#[doc = " The current version of the unified model."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub version: Option<f64>,
#[doc = " A list of environment IDs where this unified model is installed."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub installed_environment: Option<Vec<String>>,
#[doc = " The team object that owns this unified model."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub team: Option<TeamSchema>,
}
#[doc = " The sharing policy of the unified model."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum UnifiedModelResponseSharing {
#[doc = " `allow`"]
Allow,
#[doc = " `ask`"]
Ask,
#[doc = " `deny`"]
Deny,
/// A value not known to this version of the SDK.
Other(String),
}
impl UnifiedModelResponseSharing {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Allow => "allow",
Self::Ask => "ask",
Self::Deny => "deny",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for UnifiedModelResponseSharing {
fn from(s: &str) -> Self {
match s {
"allow" => Self::Allow,
"ask" => Self::Ask,
"deny" => Self::Deny,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for UnifiedModelResponseSharing {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for UnifiedModelResponseSharing {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for UnifiedModelResponseSharing {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for UnifiedModelResponseSharing {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for UnifiedModelResponseSharing {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct UnifiedModelUpdateRequest {
#[doc = " The new name of the unified model, if you want to rename it."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = " The new category, if you want to change it."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub category: Option<String>,
#[doc = " A brief description of what this unified model represents."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[doc = " Updated map of resource name → `UnifiedModelResource`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resources: Option<BTreeMap<String, UnifiedModelResource>>,
#[doc = " The ID of the team that owns this unified model."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub team_id: Option<String>,
#[doc = " The current version of the unified model. Required to prevent version conflicts."]
pub version: f64,
#[doc = " Per-resource documentation."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub docs: Option<BTreeMap<String, UnifiedModelResourceDocs>>,
#[doc = " Per-resource OAuth/permission scopes required to call its methods."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scopes: Option<BTreeMap<String, Vec<String>>>,
#[doc = " Per-resource webhook routing expression (JSONata)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub webhooks: Option<BTreeMap<String, String>>,
}
#[doc = " Log entry produced by an inbound request to the Unified API or Proxy API. Use `request_type` to distinguish a unified-mapping call from a raw proxy passthrough."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct UnifiedProxyApiLog {
#[doc = " The time at which the log entry was recorded."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub timestamp: Option<String>,
#[doc = " Human-readable summary of the log event."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[doc = " The service that generated the log."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub service: Option<String>,
#[doc = " The deployment that wrote the log (`production`, `staging`, `staging2`, `thoropass-production`, and per-developer preview deployments). Distinct from `environment_id`, which is the Truto environment the log belongs to: a single `environment_id` can be served by more than one deployment, and `app_env` is what tells them apart. Not an enumerated set — new deployments add values."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub app_env: Option<String>,
#[doc = " The Truto environment in which the log was generated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub log_type: Option<UnifiedProxyApiLogLogType>,
#[doc = " Internal log messages captured during request/job processing."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub logs: Option<Vec<String>>,
#[doc = " The hostname that served the request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub host: Option<String>,
#[doc = " The full URL of the request (with sensitive paths masked)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_url: Option<String>,
#[doc = " The HTTP status code of the response."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_status_code: Option<i64>,
#[doc = " The HTTP method of the request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_method: Option<String>,
#[doc = " The IP address of the client."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_ip: Option<String>,
#[doc = " The Cloudflare Ray ID for the request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_request_id: Option<String>,
#[doc = " The country code of the client (from Cloudflare)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_country: Option<String>,
#[doc = " The User-Agent header of the request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_useragent: Option<String>,
#[doc = " The hostname portion of the request URL."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_url_details_host: Option<String>,
#[doc = " The path portion of the request URL. On `mcp` rows the token segment is masked in full, so the value is always `/mcp/[redacted]` and identifies nothing — use `mcp_server_id` / `mcp_server_name` instead."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_url_details_path: Option<String>,
#[doc = " The parsed query string parameters of the request URL."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_url_details_query_string: Option<Map<String, Value>>,
#[doc = " The URL scheme."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_url_details_scheme: Option<String>,
#[doc = " The HTTP protocol version."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub http_version: Option<String>,
#[doc = " How the request was authenticated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authentication_type: Option<HttpRequestFieldsAuthenticationType>,
#[doc = " The ID of the authenticated user, if applicable."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub user_id: Option<String>,
#[doc = " The response headers returned to the client."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response_headers: Option<BTreeMap<String, String>>,
#[doc = " Whether the request was served by a Unified API mapping or a raw Proxy API passthrough."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub request_type: Option<UnifiedProxyApiLogRequestType>,
#[doc = " Total time in milliseconds between Truto receiving the request and sending the response."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub duration: Option<f64>,
#[doc = " Time in milliseconds spent fetching data from the upstream API."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub fetch_duration: Option<f64>,
#[doc = " The integrated account that the request was made against."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integrated_account_id: Option<String>,
#[doc = " The integration name that handled the request."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration: Option<String>,
#[doc = " The Truto method that was called (`list`, `get`, `create`, `update`, `delete`, or a custom method name)."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub method: Option<String>,
#[doc = " The Truto resource that was called."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource: Option<String>,
#[doc = " Upstream HTTP requests made to third-party APIs during processing."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub remote_requests: Option<Vec<UnifiedProxyApiLogRemoteRequestsItem>>,
#[doc = " Whether the integrated account's credentials need to be refreshed."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integrated_account_needs_reauth: Option<bool>,
#[doc = " The number of results returned by a list operation."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub result_count: Option<i64>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum UnifiedProxyApiLogLogType {
#[doc = " `unified_proxy_api`"]
UnifiedProxyApi,
/// A value not known to this version of the SDK.
Other(String),
}
impl UnifiedProxyApiLogLogType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::UnifiedProxyApi => "unified_proxy_api",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for UnifiedProxyApiLogLogType {
fn from(s: &str) -> Self {
match s {
"unified_proxy_api" => Self::UnifiedProxyApi,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for UnifiedProxyApiLogLogType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for UnifiedProxyApiLogLogType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for UnifiedProxyApiLogLogType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for UnifiedProxyApiLogLogType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for UnifiedProxyApiLogLogType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct UnifiedProxyApiLogRemoteRequestsItem {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub method: Option<String>,
}
#[doc = " Whether the request was served by a Unified API mapping or a raw Proxy API passthrough."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum UnifiedProxyApiLogRequestType {
#[doc = " `unified`"]
Unified,
#[doc = " `proxy`"]
Proxy,
/// A value not known to this version of the SDK.
Other(String),
}
impl UnifiedProxyApiLogRequestType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Unified => "unified",
Self::Proxy => "proxy",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for UnifiedProxyApiLogRequestType {
fn from(s: &str) -> Self {
match s {
"unified" => Self::Unified,
"proxy" => Self::Proxy,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for UnifiedProxyApiLogRequestType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for UnifiedProxyApiLogRequestType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for UnifiedProxyApiLogRequestType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for UnifiedProxyApiLogRequestType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for UnifiedProxyApiLogRequestType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct WebhookCreateRequest {
#[doc = " The URL where the webhook payload will be sent."]
pub target_url: String,
#[doc = " Whether the webhook is active or not."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_active: Option<bool>,
#[doc = " The list of event types that the webhook is subscribed to. If not specified, then the webhook will be subscribed to all event types."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub event_types: Option<Vec<WebhookEventTypes>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct WebhookCreateResponse {
#[doc = " The ID of the webhook."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The URL where the webhook should send the data."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub target_url: Option<String>,
#[doc = " Whether the webhook is active or not. Inactive webhooks will not receive any data."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_active: Option<bool>,
#[doc = " The ID of the environment that this webhook belongs to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[doc = " The list of event types that the webhook is subscribed to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub event_types: Option<Vec<WebhookEventTypes>>,
#[doc = " The date and time when the webhook was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the webhook was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
#[doc = " The secret key that will be used to sign the webhook payload."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub secret: Option<String>,
}
#[doc = " The event type of a webhook."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum WebhookEventTypes {
#[doc = " `sync_job_run:created`"]
SyncJobRunCreated,
#[doc = " `sync_job_run:updated`"]
SyncJobRunUpdated,
#[doc = " `sync_job_run:started`"]
SyncJobRunStarted,
#[doc = " `sync_job_run:completed`"]
SyncJobRunCompleted,
#[doc = " `sync_job_run:failed`"]
SyncJobRunFailed,
#[doc = " `sync_job_run:record`"]
SyncJobRunRecord,
#[doc = " `sync_job_run:rate_limited`"]
SyncJobRunRateLimited,
#[doc = " `integrated_account:created`"]
IntegratedAccountCreated,
#[doc = " `integrated_account:updated`"]
IntegratedAccountUpdated,
#[doc = " `integrated_account:active`"]
IntegratedAccountActive,
#[doc = " `integrated_account:reactivated`"]
IntegratedAccountReactivated,
#[doc = " `integrated_account:authentication_error`"]
IntegratedAccountAuthenticationError,
#[doc = " `integrated_account:forbidden_error`"]
IntegratedAccountForbiddenError,
#[doc = " `integrated_account:post_install_error`"]
IntegratedAccountPostInstallError,
#[doc = " `integrated_account:validation_error`"]
IntegratedAccountValidationError,
#[doc = " `integrated_account:post_connect_form_submitted`"]
IntegratedAccountPostConnectFormSubmitted,
#[doc = " `link_token:connection_error`"]
LinkTokenConnectionError,
#[doc = " `record:created`"]
RecordCreated,
#[doc = " `record:updated`"]
RecordUpdated,
#[doc = " `record:deleted`"]
RecordDeleted,
#[doc = " `sync_job_cron_trigger:failed`"]
SyncJobCronTriggerFailed,
#[doc = " `batch_job:dry_run_completed`"]
BatchJobDryRunCompleted,
#[doc = " `batch_job:completed`"]
BatchJobCompleted,
#[doc = " `batch_job:dry_run_failed`"]
BatchJobDryRunFailed,
#[doc = " `batch_job:failed`"]
BatchJobFailed,
/// A value not known to this version of the SDK.
Other(String),
}
impl WebhookEventTypes {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::SyncJobRunCreated => "sync_job_run:created",
Self::SyncJobRunUpdated => "sync_job_run:updated",
Self::SyncJobRunStarted => "sync_job_run:started",
Self::SyncJobRunCompleted => "sync_job_run:completed",
Self::SyncJobRunFailed => "sync_job_run:failed",
Self::SyncJobRunRecord => "sync_job_run:record",
Self::SyncJobRunRateLimited => "sync_job_run:rate_limited",
Self::IntegratedAccountCreated => "integrated_account:created",
Self::IntegratedAccountUpdated => "integrated_account:updated",
Self::IntegratedAccountActive => "integrated_account:active",
Self::IntegratedAccountReactivated => "integrated_account:reactivated",
Self::IntegratedAccountAuthenticationError => "integrated_account:authentication_error",
Self::IntegratedAccountForbiddenError => "integrated_account:forbidden_error",
Self::IntegratedAccountPostInstallError => "integrated_account:post_install_error",
Self::IntegratedAccountValidationError => "integrated_account:validation_error",
Self::IntegratedAccountPostConnectFormSubmitted => "integrated_account:post_connect_form_submitted",
Self::LinkTokenConnectionError => "link_token:connection_error",
Self::RecordCreated => "record:created",
Self::RecordUpdated => "record:updated",
Self::RecordDeleted => "record:deleted",
Self::SyncJobCronTriggerFailed => "sync_job_cron_trigger:failed",
Self::BatchJobDryRunCompleted => "batch_job:dry_run_completed",
Self::BatchJobCompleted => "batch_job:completed",
Self::BatchJobDryRunFailed => "batch_job:dry_run_failed",
Self::BatchJobFailed => "batch_job:failed",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for WebhookEventTypes {
fn from(s: &str) -> Self {
match s {
"sync_job_run:created" => Self::SyncJobRunCreated,
"sync_job_run:updated" => Self::SyncJobRunUpdated,
"sync_job_run:started" => Self::SyncJobRunStarted,
"sync_job_run:completed" => Self::SyncJobRunCompleted,
"sync_job_run:failed" => Self::SyncJobRunFailed,
"sync_job_run:record" => Self::SyncJobRunRecord,
"sync_job_run:rate_limited" => Self::SyncJobRunRateLimited,
"integrated_account:created" => Self::IntegratedAccountCreated,
"integrated_account:updated" => Self::IntegratedAccountUpdated,
"integrated_account:active" => Self::IntegratedAccountActive,
"integrated_account:reactivated" => Self::IntegratedAccountReactivated,
"integrated_account:authentication_error" => Self::IntegratedAccountAuthenticationError,
"integrated_account:forbidden_error" => Self::IntegratedAccountForbiddenError,
"integrated_account:post_install_error" => Self::IntegratedAccountPostInstallError,
"integrated_account:validation_error" => Self::IntegratedAccountValidationError,
"integrated_account:post_connect_form_submitted" => Self::IntegratedAccountPostConnectFormSubmitted,
"link_token:connection_error" => Self::LinkTokenConnectionError,
"record:created" => Self::RecordCreated,
"record:updated" => Self::RecordUpdated,
"record:deleted" => Self::RecordDeleted,
"sync_job_cron_trigger:failed" => Self::SyncJobCronTriggerFailed,
"batch_job:dry_run_completed" => Self::BatchJobDryRunCompleted,
"batch_job:completed" => Self::BatchJobCompleted,
"batch_job:dry_run_failed" => Self::BatchJobDryRunFailed,
"batch_job:failed" => Self::BatchJobFailed,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for WebhookEventTypes {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for WebhookEventTypes {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for WebhookEventTypes {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for WebhookEventTypes {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for WebhookEventTypes {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Log entry produced when Truto delivers a webhook to a customer endpoint. Delivery runs in the `webhook_delivery` Durable Object; the `webhooks` queue only hands the event to that object and emits no logs of its own, so these rows carry `durable_object`, not `queue`."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct WebhookLog {
#[doc = " The time at which the log entry was recorded."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub timestamp: Option<String>,
#[doc = " Human-readable summary of the log event."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[doc = " The service that generated the log."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub service: Option<String>,
#[doc = " The deployment that wrote the log (`production`, `staging`, `staging2`, `thoropass-production`, and per-developer preview deployments). Distinct from `environment_id`, which is the Truto environment the log belongs to: a single `environment_id` can be served by more than one deployment, and `app_env` is what tells them apart. Not an enumerated set — new deployments add values."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub app_env: Option<String>,
#[doc = " The Truto environment in which the log was generated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub log_type: Option<WebhookLogLogType>,
#[doc = " Internal log messages captured during request/job processing."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub logs: Option<Vec<String>>,
#[doc = " The Durable Object class that emitted the log."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub durable_object: Option<WebhookLogDurableObject>,
#[doc = " Which delivery path emitted the row — `deliver` for the first attempt, `alarm` for a scheduled retry. This is not a Truto API method."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub method: Option<WebhookLogMethod>,
#[doc = " Only ever set to `error`, on a failed or skipped delivery. Absent on a successful delivery — read `webhook_endpoint_status` for the endpoint's response code."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status: Option<WebhookLogStatus>,
#[doc = " The event that triggered the webhook delivery. Filter on it with the `event` key of `log_type_filter`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub event_type: Option<String>,
#[doc = " The webhook configuration that fired."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub webhook_id: Option<String>,
#[doc = " The integrated account the event originated from, when the payload identifies one."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integrated_account_id: Option<String>,
#[doc = " The integration slug the event originated from, when the payload identifies one."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integration: Option<String>,
#[doc = " The HTTP status code returned by the customer's webhook endpoint. Absent for connection-level failures, where no HTTP response was received."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub webhook_endpoint_status: Option<i64>,
}
#[doc = " The Durable Object class that emitted the log."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum WebhookLogDurableObject {
#[doc = " `webhook_delivery`"]
WebhookDelivery,
/// A value not known to this version of the SDK.
Other(String),
}
impl WebhookLogDurableObject {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::WebhookDelivery => "webhook_delivery",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for WebhookLogDurableObject {
fn from(s: &str) -> Self {
match s {
"webhook_delivery" => Self::WebhookDelivery,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for WebhookLogDurableObject {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for WebhookLogDurableObject {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for WebhookLogDurableObject {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for WebhookLogDurableObject {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for WebhookLogDurableObject {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum WebhookLogLogType {
#[doc = " `webhook`"]
Webhook,
/// A value not known to this version of the SDK.
Other(String),
}
impl WebhookLogLogType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Webhook => "webhook",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for WebhookLogLogType {
fn from(s: &str) -> Self {
match s {
"webhook" => Self::Webhook,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for WebhookLogLogType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for WebhookLogLogType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for WebhookLogLogType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for WebhookLogLogType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for WebhookLogLogType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Which delivery path emitted the row — `deliver` for the first attempt, `alarm` for a scheduled retry. This is not a Truto API method."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum WebhookLogMethod {
#[doc = " `deliver`"]
Deliver,
#[doc = " `alarm`"]
Alarm,
/// A value not known to this version of the SDK.
Other(String),
}
impl WebhookLogMethod {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Deliver => "deliver",
Self::Alarm => "alarm",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for WebhookLogMethod {
fn from(s: &str) -> Self {
match s {
"deliver" => Self::Deliver,
"alarm" => Self::Alarm,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for WebhookLogMethod {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for WebhookLogMethod {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for WebhookLogMethod {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for WebhookLogMethod {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for WebhookLogMethod {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[doc = " Only ever set to `error`, on a failed or skipped delivery. Absent on a successful delivery — read `webhook_endpoint_status` for the endpoint's response code."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum WebhookLogStatus {
#[doc = " `error`"]
Error,
/// A value not known to this version of the SDK.
Other(String),
}
impl WebhookLogStatus {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Error => "error",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for WebhookLogStatus {
fn from(s: &str) -> Self {
match s {
"error" => Self::Error,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for WebhookLogStatus {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for WebhookLogStatus {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for WebhookLogStatus {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for WebhookLogStatus {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for WebhookLogStatus {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct WebhookSchema {
#[doc = " The ID of the webhook."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The URL where the webhook should send the data."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub target_url: Option<String>,
#[doc = " Whether the webhook is active or not. Inactive webhooks will not receive any data."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_active: Option<bool>,
#[doc = " The ID of the environment that this webhook belongs to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub environment_id: Option<String>,
#[doc = " The list of event types that the webhook is subscribed to."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub event_types: Option<Vec<WebhookEventTypes>>,
#[doc = " The date and time when the webhook was created."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[doc = " The date and time when the webhook was last updated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
}
#[doc = " The event type to simulate with `POST /webhook/test`. Every event type the platform emits — each one delivers a payload shaped like the real thing."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum WebhookTestEventTypes {
#[doc = " `integrated_account:created`"]
IntegratedAccountCreated,
#[doc = " `integrated_account:updated`"]
IntegratedAccountUpdated,
#[doc = " `integrated_account:deleted`"]
IntegratedAccountDeleted,
#[doc = " `integrated_account:active`"]
IntegratedAccountActive,
#[doc = " `integrated_account:post_connect_form_submitted`"]
IntegratedAccountPostConnectFormSubmitted,
#[doc = " `integrated_account:post_install_error`"]
IntegratedAccountPostInstallError,
#[doc = " `integrated_account:validation_error`"]
IntegratedAccountValidationError,
#[doc = " `integrated_account:authentication_error`"]
IntegratedAccountAuthenticationError,
#[doc = " `integrated_account:forbidden_error`"]
IntegratedAccountForbiddenError,
#[doc = " `integrated_account:reactivated`"]
IntegratedAccountReactivated,
#[doc = " `link_token:connection_error`"]
LinkTokenConnectionError,
#[doc = " `environment_integration:created`"]
EnvironmentIntegrationCreated,
#[doc = " `environment_integration:updated`"]
EnvironmentIntegrationUpdated,
#[doc = " `environment_integration:deleted`"]
EnvironmentIntegrationDeleted,
#[doc = " `environment_unified_model:created`"]
EnvironmentUnifiedModelCreated,
#[doc = " `environment_unified_model:updated`"]
EnvironmentUnifiedModelUpdated,
#[doc = " `environment_unified_model:deleted`"]
EnvironmentUnifiedModelDeleted,
#[doc = " `api_token:created`"]
ApiTokenCreated,
#[doc = " `api_token:deleted`"]
ApiTokenDeleted,
#[doc = " `sync_job_run:created`"]
SyncJobRunCreated,
#[doc = " `sync_job_run:updated`"]
SyncJobRunUpdated,
#[doc = " `sync_job_run:started`"]
SyncJobRunStarted,
#[doc = " `sync_job_run:completed`"]
SyncJobRunCompleted,
#[doc = " `sync_job_run:failed`"]
SyncJobRunFailed,
#[doc = " `sync_job_run:deleted`"]
SyncJobRunDeleted,
#[doc = " `sync_job_run:record`"]
SyncJobRunRecord,
#[doc = " `sync_job_run:record_error`"]
SyncJobRunRecordError,
#[doc = " `sync_job_run:rate_limited`"]
SyncJobRunRateLimited,
#[doc = " `record:created`"]
RecordCreated,
#[doc = " `record:updated`"]
RecordUpdated,
#[doc = " `record:deleted`"]
RecordDeleted,
#[doc = " `record:meta`"]
RecordMeta,
#[doc = " `sync_job_cron_trigger:failed`"]
SyncJobCronTriggerFailed,
#[doc = " `batch_job:dry_run_completed`"]
BatchJobDryRunCompleted,
#[doc = " `batch_job:completed`"]
BatchJobCompleted,
#[doc = " `batch_job:dry_run_failed`"]
BatchJobDryRunFailed,
#[doc = " `batch_job:failed`"]
BatchJobFailed,
/// A value not known to this version of the SDK.
Other(String),
}
impl WebhookTestEventTypes {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::IntegratedAccountCreated => "integrated_account:created",
Self::IntegratedAccountUpdated => "integrated_account:updated",
Self::IntegratedAccountDeleted => "integrated_account:deleted",
Self::IntegratedAccountActive => "integrated_account:active",
Self::IntegratedAccountPostConnectFormSubmitted => "integrated_account:post_connect_form_submitted",
Self::IntegratedAccountPostInstallError => "integrated_account:post_install_error",
Self::IntegratedAccountValidationError => "integrated_account:validation_error",
Self::IntegratedAccountAuthenticationError => "integrated_account:authentication_error",
Self::IntegratedAccountForbiddenError => "integrated_account:forbidden_error",
Self::IntegratedAccountReactivated => "integrated_account:reactivated",
Self::LinkTokenConnectionError => "link_token:connection_error",
Self::EnvironmentIntegrationCreated => "environment_integration:created",
Self::EnvironmentIntegrationUpdated => "environment_integration:updated",
Self::EnvironmentIntegrationDeleted => "environment_integration:deleted",
Self::EnvironmentUnifiedModelCreated => "environment_unified_model:created",
Self::EnvironmentUnifiedModelUpdated => "environment_unified_model:updated",
Self::EnvironmentUnifiedModelDeleted => "environment_unified_model:deleted",
Self::ApiTokenCreated => "api_token:created",
Self::ApiTokenDeleted => "api_token:deleted",
Self::SyncJobRunCreated => "sync_job_run:created",
Self::SyncJobRunUpdated => "sync_job_run:updated",
Self::SyncJobRunStarted => "sync_job_run:started",
Self::SyncJobRunCompleted => "sync_job_run:completed",
Self::SyncJobRunFailed => "sync_job_run:failed",
Self::SyncJobRunDeleted => "sync_job_run:deleted",
Self::SyncJobRunRecord => "sync_job_run:record",
Self::SyncJobRunRecordError => "sync_job_run:record_error",
Self::SyncJobRunRateLimited => "sync_job_run:rate_limited",
Self::RecordCreated => "record:created",
Self::RecordUpdated => "record:updated",
Self::RecordDeleted => "record:deleted",
Self::RecordMeta => "record:meta",
Self::SyncJobCronTriggerFailed => "sync_job_cron_trigger:failed",
Self::BatchJobDryRunCompleted => "batch_job:dry_run_completed",
Self::BatchJobCompleted => "batch_job:completed",
Self::BatchJobDryRunFailed => "batch_job:dry_run_failed",
Self::BatchJobFailed => "batch_job:failed",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for WebhookTestEventTypes {
fn from(s: &str) -> Self {
match s {
"integrated_account:created" => Self::IntegratedAccountCreated,
"integrated_account:updated" => Self::IntegratedAccountUpdated,
"integrated_account:deleted" => Self::IntegratedAccountDeleted,
"integrated_account:active" => Self::IntegratedAccountActive,
"integrated_account:post_connect_form_submitted" => Self::IntegratedAccountPostConnectFormSubmitted,
"integrated_account:post_install_error" => Self::IntegratedAccountPostInstallError,
"integrated_account:validation_error" => Self::IntegratedAccountValidationError,
"integrated_account:authentication_error" => Self::IntegratedAccountAuthenticationError,
"integrated_account:forbidden_error" => Self::IntegratedAccountForbiddenError,
"integrated_account:reactivated" => Self::IntegratedAccountReactivated,
"link_token:connection_error" => Self::LinkTokenConnectionError,
"environment_integration:created" => Self::EnvironmentIntegrationCreated,
"environment_integration:updated" => Self::EnvironmentIntegrationUpdated,
"environment_integration:deleted" => Self::EnvironmentIntegrationDeleted,
"environment_unified_model:created" => Self::EnvironmentUnifiedModelCreated,
"environment_unified_model:updated" => Self::EnvironmentUnifiedModelUpdated,
"environment_unified_model:deleted" => Self::EnvironmentUnifiedModelDeleted,
"api_token:created" => Self::ApiTokenCreated,
"api_token:deleted" => Self::ApiTokenDeleted,
"sync_job_run:created" => Self::SyncJobRunCreated,
"sync_job_run:updated" => Self::SyncJobRunUpdated,
"sync_job_run:started" => Self::SyncJobRunStarted,
"sync_job_run:completed" => Self::SyncJobRunCompleted,
"sync_job_run:failed" => Self::SyncJobRunFailed,
"sync_job_run:deleted" => Self::SyncJobRunDeleted,
"sync_job_run:record" => Self::SyncJobRunRecord,
"sync_job_run:record_error" => Self::SyncJobRunRecordError,
"sync_job_run:rate_limited" => Self::SyncJobRunRateLimited,
"record:created" => Self::RecordCreated,
"record:updated" => Self::RecordUpdated,
"record:deleted" => Self::RecordDeleted,
"record:meta" => Self::RecordMeta,
"sync_job_cron_trigger:failed" => Self::SyncJobCronTriggerFailed,
"batch_job:dry_run_completed" => Self::BatchJobDryRunCompleted,
"batch_job:completed" => Self::BatchJobCompleted,
"batch_job:dry_run_failed" => Self::BatchJobDryRunFailed,
"batch_job:failed" => Self::BatchJobFailed,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for WebhookTestEventTypes {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for WebhookTestEventTypes {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for WebhookTestEventTypes {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for WebhookTestEventTypes {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for WebhookTestEventTypes {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct WebhookTestRequest {
#[doc = " ID of the webhook you want to send the test event to."]
pub id: String,
#[doc = " The event type to simulate. Defaults to `integrated_account:created`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub event_type: Option<WebhookTestEventTypes>,
#[doc = " Build the payload from this connected account instead of placeholder data. Must belong to the same environment as the webhook. Credentials are stripped before delivery."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub integrated_account_id: Option<String>,
#[doc = " Values deep-merged over the generated payload, for pinning fields your handler branches on."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub payload: Option<Map<String, Value>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct WebhookTestResponse {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub success: Option<bool>,
#[doc = " The event type that was delivered."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub event_type: Option<WebhookTestEventTypes>,
#[doc = " The payload that was delivered, after any overrides."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub payload: Option<Map<String, Value>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct WebhookUpdateRequest {
#[doc = " The URL where the webhook payload will be sent."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub target_url: Option<String>,
#[doc = " Whether the webhook is active or not."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub is_active: Option<bool>,
#[doc = " The list of event types that the webhook is subscribed to. If not specified, then the webhook will be subscribed to all event types."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub event_types: Option<Vec<WebhookEventTypes>>,
}
#[doc = " Workflow execution configuration."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct WorkflowConfigSchema {
#[doc = " JSONata condition evaluated before executing workflow steps."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub run_if: Option<String>,
pub steps: Vec<WorkflowStepSchema>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct WorkflowCreateSchema {
#[doc = " Optional workflow ID. If not provided, it will be generated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = " The environment in which this workflow is created."]
pub environment_id: String,
#[doc = " The event that triggers this workflow."]
pub trigger_name: String,
#[doc = " Workflow execution configuration, as an object or a JSON string of one. A string that isn't valid JSON, or a config of another shape, is a `400`."]
pub config: WorkflowConfigSchema,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct WorkflowDeleteResponse {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub success: Option<bool>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct WorkflowRunResponse {
pub id: String,
pub workflow_id: String,
pub environment_id: String,
pub status: WorkflowRunResponseStatus,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub result: Option<WorkflowRunResultSchema>,
pub retry_attempt: f64,
pub created_at: String,
pub updated_at: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub started_at: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub finished_at: Option<String>,
}
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum WorkflowRunResponseStatus {
#[doc = " `created`"]
Created,
#[doc = " `running`"]
Running,
#[doc = " `completed`"]
Completed,
#[doc = " `failed`"]
Failed,
/// A value not known to this version of the SDK.
Other(String),
}
impl WorkflowRunResponseStatus {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Created => "created",
Self::Running => "running",
Self::Completed => "completed",
Self::Failed => "failed",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for WorkflowRunResponseStatus {
fn from(s: &str) -> Self {
match s {
"created" => Self::Created,
"running" => Self::Running,
"completed" => Self::Completed,
"failed" => Self::Failed,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for WorkflowRunResponseStatus {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for WorkflowRunResponseStatus {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for WorkflowRunResponseStatus {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for WorkflowRunResponseStatus {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for WorkflowRunResponseStatus {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct WorkflowRunResultSchema {
pub steps: Vec<WorkflowRunStepSchema>,
pub success: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct WorkflowRunStepSchema {
pub r#type: String,
pub action: String,
pub success: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub result: Option<Map<String, Value>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct WorkflowSchema {
pub id: String,
pub environment_id: String,
pub trigger_name: String,
pub config: WorkflowConfigSchema,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
}
#[doc = " A single executable step in a workflow."]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct WorkflowStepSchema {
#[doc = " Step execution type."]
pub r#type: WorkflowStepSchemaType,
#[doc = " Action executed by the step."]
pub action: String,
#[doc = " Optional cron expression for scheduled execution, in UTC. When set, the step creates a sync job cron trigger instead of starting a run, so the trigger's check applies: the step fails if the expression doesn't parse or its next two runs are less than 5 minutes apart."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cron_expression: Option<String>,
#[doc = " JSONata expression evaluated at runtime to generate the step execution payload."]
pub config: String,
}
#[doc = " Step execution type."]
///
/// Open enum: values this SDK does not know decode as `Other` and
/// serialise back unchanged.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum WorkflowStepSchemaType {
#[doc = " `run`"]
Run,
/// A value not known to this version of the SDK.
Other(String),
}
impl WorkflowStepSchemaType {
/// The wire value.
pub fn as_str(&self) -> &str {
match self {
Self::Run => "run",
Self::Other(s) => s.as_str(),
}
}
}
impl From<&str> for WorkflowStepSchemaType {
fn from(s: &str) -> Self {
match s {
"run" => Self::Run,
other => Self::Other(other.to_owned()),
}
}
}
impl From<String> for WorkflowStepSchemaType {
fn from(s: String) -> Self {
Self::from(s.as_str())
}
}
impl Default for WorkflowStepSchemaType {
fn default() -> Self {
Self::Other(String::new())
}
}
impl fmt::Display for WorkflowStepSchemaType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Serialize for WorkflowStepSchemaType {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(self.as_str())
}
}
impl<'de> Deserialize<'de> for WorkflowStepSchemaType {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from(open_enum_string(deserializer)?))
}
}