// AUTO-GENERATED by build.rs from schemas/. DO NOT EDIT.
// Regenerate: cargo build (touches `schemas/` to invalidate).
#![allow(clippy::all, dead_code, unused_imports)]
/// Error types.
pub mod error {
/// Error from a `TryFrom` or `FromStr` implementation.
pub struct ConversionError(::std::borrow::Cow<'static, str>);
impl ::std::error::Error for ConversionError {}
impl ::std::fmt::Display for ConversionError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
::std::fmt::Display::fmt(&self.0, f)
}
}
impl ::std::fmt::Debug for ConversionError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
::std::fmt::Debug::fmt(&self.0, f)
}
}
impl From<&'static str> for ConversionError {
fn from(value: &'static str) -> Self {
Self(value.into())
}
}
impl From<String> for ConversionError {
fn from(value: String) -> Self {
Self(value.into())
}
}
}
///CloudEvents 'source' attribute value — the agent platform identifier that emitted the event. Client forwards any string verbatim; the list below is the canonical set of agent platforms recognised by current OpenLatch tooling. Unknown values are preserved and forwarded unchanged (surfaced in Rust as AgentType::Unknown(String) via the tagged-enum lens).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "CloudEvents 'source' attribute value — the agent platform identifier that emitted the event. Client forwards any string verbatim; the list below is the canonical set of agent platforms recognised by current OpenLatch tooling. Unknown values are preserved and forwarded unchanged (surfaced in Rust as AgentType::Unknown(String) via the tagged-enum lens).",
/// "type": "string",
/// "x-known-values": [
/// "claude-code",
/// "cursor",
/// "windsurf",
/// "github-copilot",
/// "codex-cli",
/// "gemini-cli",
/// "cline",
/// "openclaw"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct AgentType(pub ::std::string::String);
impl ::std::ops::Deref for AgentType {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<AgentType> for ::std::string::String {
fn from(value: AgentType) -> Self {
value.0
}
}
impl ::std::convert::From<::std::string::String> for AgentType {
fn from(value: ::std::string::String) -> Self {
Self(value)
}
}
impl ::std::str::FromStr for AgentType {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(Self(value.to_string()))
}
}
impl ::std::fmt::Display for AgentType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
self.0.fmt(f)
}
}
///Response from GET /api/v1/users/me for auth status validation (D-19) and PostHog identity stitching (telemetry Phase C). user_db_id, when present, is used as the persistent distinct_id and triggers a one-time $create_alias merging prior agent_id events into the platform person. Mirrors the `id` field on the platform side; both carry the stable better-auth user TEXT primary key.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "AuthMeResponse",
/// "description": "Response from GET /api/v1/users/me for auth status validation (D-19) and PostHog identity stitching (telemetry Phase C). user_db_id, when present, is used as the persistent distinct_id and triggers a one-time $create_alias merging prior agent_id events into the platform person. Mirrors the `id` field on the platform side; both carry the stable better-auth user TEXT primary key.",
/// "type": "object",
/// "properties": {
/// "email": {
/// "description": "Email of the authenticated user.",
/// "type": "string"
/// },
/// "id": {
/// "description": "Stable database identifier for the authenticated user (better-auth user.id). Mirror of user_db_id — either field may be read; prefer user_db_id for telemetry alias semantics.",
/// "type": "string"
/// },
/// "organization_id": {
/// "description": "Organization id for the user's active organization.",
/// "type": "string"
/// },
/// "organization_name": {
/// "description": "Human-readable display name of the user's active organization. Surfaced by the client on re-runs of `openlatch init` so the user can confirm which org their cached credential belongs to. Optional — when absent, the client displays `Authenticated` without the parenthetical org suffix.",
/// "type": "string"
/// },
/// "user_db_id": {
/// "description": "Stable database identifier for the authenticated user. Used as the PostHog distinct_id post-auth and as the alias target for $create_alias. Optional in this client schema for backwards compatibility — older platforms may not return it; client falls back to agent_id and skips the alias when absent.",
/// "type": "string"
/// }
/// },
/// "additionalProperties": true,
/// "x-postgresql-skip": true
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AuthMeResponse {
///Email of the authenticated user.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub email: ::std::option::Option<::std::string::String>,
///Stable database identifier for the authenticated user (better-auth user.id). Mirror of user_db_id — either field may be read; prefer user_db_id for telemetry alias semantics.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub id: ::std::option::Option<::std::string::String>,
///Organization id for the user's active organization.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub organization_id: ::std::option::Option<::std::string::String>,
///Human-readable display name of the user's active organization. Surfaced by the client on re-runs of `openlatch init` so the user can confirm which org their cached credential belongs to. Optional — when absent, the client displays `Authenticated` without the parenthetical org suffix.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub organization_name: ::std::option::Option<::std::string::String>,
///Stable database identifier for the authenticated user. Used as the PostHog distinct_id post-auth and as the alias target for $create_alias. Optional in this client schema for backwards compatibility — older platforms may not return it; client falls back to agent_id and skips the alias when absent.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub user_db_id: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for AuthMeResponse {
fn default() -> Self {
Self {
email: Default::default(),
id: Default::default(),
organization_id: Default::default(),
organization_name: Default::default(),
user_db_id: Default::default(),
}
}
}
impl AuthMeResponse {
pub fn builder() -> builder::AuthMeResponse {
Default::default()
}
}
///Routing-score components surfaced by GET /api/v1/editor/bindings/{id}/metrics.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "Binding Metrics",
/// "description": "Routing-score components surfaced by GET /api/v1/editor/bindings/{id}/metrics.",
/// "type": "object",
/// "required": [
/// "binding_id",
/// "latency_ms",
/// "score",
/// "success_rate_24h"
/// ],
/// "properties": {
/// "active_penalty": {
/// "type": "number"
/// },
/// "binding_id": {
/// "type": "string"
/// },
/// "latency_ms": {
/// "type": "object",
/// "required": [
/// "p50",
/// "p95",
/// "p99"
/// ],
/// "properties": {
/// "p50": {
/// "type": "integer",
/// "minimum": 0.0
/// },
/// "p95": {
/// "type": "integer",
/// "minimum": 0.0
/// },
/// "p99": {
/// "type": "integer",
/// "minimum": 0.0
/// }
/// },
/// "additionalProperties": false
/// },
/// "score": {
/// "type": "number"
/// },
/// "score_components": {
/// "type": "object",
/// "additionalProperties": true
/// },
/// "success_rate_24h": {
/// "type": "number",
/// "maximum": 1.0,
/// "minimum": 0.0
/// },
/// "thumbs_down_rate_7d": {
/// "type": "number",
/// "maximum": 1.0,
/// "minimum": 0.0
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct BindingMetricsResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub active_penalty: ::std::option::Option<f64>,
pub binding_id: ::std::string::String,
pub latency_ms: BindingMetricsResponseLatencyMs,
pub score: f64,
#[serde(default, skip_serializing_if = "::serde_json::Map::is_empty")]
pub score_components: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
pub success_rate_24h: f64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub thumbs_down_rate_7d: ::std::option::Option<f64>,
}
impl BindingMetricsResponse {
pub fn builder() -> builder::BindingMetricsResponse {
Default::default()
}
}
///`BindingMetricsResponseLatencyMs`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "p50",
/// "p95",
/// "p99"
/// ],
/// "properties": {
/// "p50": {
/// "type": "integer",
/// "minimum": 0.0
/// },
/// "p95": {
/// "type": "integer",
/// "minimum": 0.0
/// },
/// "p99": {
/// "type": "integer",
/// "minimum": 0.0
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct BindingMetricsResponseLatencyMs {
pub p50: u64,
pub p95: u64,
pub p99: u64,
}
impl BindingMetricsResponseLatencyMs {
pub fn builder() -> builder::BindingMetricsResponseLatencyMs {
Default::default()
}
}
///`BindingV2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "capacity_qps",
/// "declared_latency_p95_ms",
/// "priority",
/// "provider",
/// "tool"
/// ],
/// "properties": {
/// "capacity_qps": {
/// "type": "integer",
/// "minimum": 1.0
/// },
/// "compliance": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "data_handling": {
/// "type": "object",
/// "additionalProperties": true
/// },
/// "declared_latency_p95_ms": {
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 1.0
/// },
/// "local_endpoint": {
/// "type": "string"
/// },
/// "pricing": {
/// "type": "object",
/// "additionalProperties": true
/// },
/// "priority": {
/// "type": "integer",
/// "maximum": 100.0,
/// "minimum": 0.0
/// },
/// "process_override": {
/// "description": "Operator-supplied overlay merged onto the tool's default `process:`. All fields optional. `command` and `command_args` are mutually exclusive (OL-4326).",
/// "$ref": "#/$defs/ProcessOverrideV2"
/// },
/// "provider": {
/// "description": "Slug of a provider defined in `providers[]`.",
/// "type": "string"
/// },
/// "tool": {
/// "description": "Qualified tool ref: `<editor-slug>/<tool-slug>@<version>`. Implicit-editor form `<tool-slug>@<version>` and `@latest` are also accepted; resolution is performed against the loaded tool registry (OL-4322/OL-4323).",
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct BindingV2 {
pub capacity_qps: ::std::num::NonZeroU64,
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub compliance: ::std::vec::Vec<::std::string::String>,
#[serde(default, skip_serializing_if = "::serde_json::Map::is_empty")]
pub data_handling: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
pub declared_latency_p95_ms: ::std::num::NonZeroU64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub local_endpoint: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::serde_json::Map::is_empty")]
pub pricing: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
pub priority: i64,
///Operator-supplied overlay merged onto the tool's default `process:`. All fields optional. `command` and `command_args` are mutually exclusive (OL-4326).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub process_override: ::std::option::Option<ProcessOverrideV2>,
///Slug of a provider defined in `providers[]`.
pub provider: ::std::string::String,
///Qualified tool ref: `<editor-slug>/<tool-slug>@<version>`. Implicit-editor form `<tool-slug>@<version>` and `@latest` are also accepted; resolution is performed against the loaded tool registry (OL-4322/OL-4323).
pub tool: ::std::string::String,
}
impl BindingV2 {
pub fn builder() -> builder::BindingV2 {
Default::default()
}
}
///Public list of supported agent platforms (used for tab-completion).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "Catalog: Agents",
/// "description": "Public list of supported agent platforms (used for tab-completion).",
/// "type": "object",
/// "required": [
/// "agents"
/// ],
/// "properties": {
/// "agents": {
/// "type": "array",
/// "items": {
/// "type": "object",
/// "required": [
/// "platform"
/// ],
/// "properties": {
/// "display_name": {
/// "type": "string"
/// },
/// "platform": {
/// "type": "string"
/// },
/// "supported_hook_events": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// }
/// },
/// "additionalProperties": false
/// }
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CatalogAgentsResponse {
pub agents: ::std::vec::Vec<CatalogAgentsResponseAgentsItem>,
}
impl CatalogAgentsResponse {
pub fn builder() -> builder::CatalogAgentsResponse {
Default::default()
}
}
///`CatalogAgentsResponseAgentsItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "platform"
/// ],
/// "properties": {
/// "display_name": {
/// "type": "string"
/// },
/// "platform": {
/// "type": "string"
/// },
/// "supported_hook_events": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CatalogAgentsResponseAgentsItem {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub display_name: ::std::option::Option<::std::string::String>,
pub platform: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub supported_hook_events: ::std::vec::Vec<::std::string::String>,
}
impl CatalogAgentsResponseAgentsItem {
pub fn builder() -> builder::CatalogAgentsResponseAgentsItem {
Default::default()
}
}
///Public, machine-readable error catalog — every OL-XXXX code with a docs URL and remediation.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "Catalog: Error codes",
/// "description": "Public, machine-readable error catalog — every OL-XXXX code with a docs URL and remediation.",
/// "type": "object",
/// "required": [
/// "error_codes"
/// ],
/// "properties": {
/// "error_codes": {
/// "type": "array",
/// "items": {
/// "type": "object",
/// "required": [
/// "code",
/// "docs_url",
/// "title"
/// ],
/// "properties": {
/// "code": {
/// "type": "string",
/// "pattern": "^OL-\\d{4}$"
/// },
/// "docs_url": {
/// "type": "string",
/// "format": "uri"
/// },
/// "remediation": {
/// "type": "string"
/// },
/// "title": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
/// }
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CatalogErrorCodesResponse {
pub error_codes: ::std::vec::Vec<CatalogErrorCodesResponseErrorCodesItem>,
}
impl CatalogErrorCodesResponse {
pub fn builder() -> builder::CatalogErrorCodesResponse {
Default::default()
}
}
///`CatalogErrorCodesResponseErrorCodesItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "code",
/// "docs_url",
/// "title"
/// ],
/// "properties": {
/// "code": {
/// "type": "string",
/// "pattern": "^OL-\\d{4}$"
/// },
/// "docs_url": {
/// "type": "string",
/// "format": "uri"
/// },
/// "remediation": {
/// "type": "string"
/// },
/// "title": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CatalogErrorCodesResponseErrorCodesItem {
pub code: CatalogErrorCodesResponseErrorCodesItemCode,
pub docs_url: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub remediation: ::std::option::Option<::std::string::String>,
pub title: ::std::string::String,
}
impl CatalogErrorCodesResponseErrorCodesItem {
pub fn builder() -> builder::CatalogErrorCodesResponseErrorCodesItem {
Default::default()
}
}
///`CatalogErrorCodesResponseErrorCodesItemCode`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "pattern": "^OL-\\d{4}$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CatalogErrorCodesResponseErrorCodesItemCode(::std::string::String);
impl ::std::ops::Deref for CatalogErrorCodesResponseErrorCodesItemCode {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<CatalogErrorCodesResponseErrorCodesItemCode> for ::std::string::String {
fn from(value: CatalogErrorCodesResponseErrorCodesItemCode) -> Self {
value.0
}
}
impl ::std::str::FromStr for CatalogErrorCodesResponseErrorCodesItemCode {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
::std::sync::LazyLock::new(|| ::regress::Regex::new("^OL-\\d{4}$").unwrap());
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^OL-\\d{4}$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for CatalogErrorCodesResponseErrorCodesItemCode {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String>
for CatalogErrorCodesResponseErrorCodesItemCode
{
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String>
for CatalogErrorCodesResponseErrorCodesItemCode
{
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for CatalogErrorCodesResponseErrorCodesItemCode {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///Public list of supported hook event types across all agent platforms (used for tab-completion).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "Catalog: Hook events",
/// "description": "Public list of supported hook event types across all agent platforms (used for tab-completion).",
/// "type": "object",
/// "required": [
/// "hooks"
/// ],
/// "properties": {
/// "hooks": {
/// "type": "array",
/// "items": {
/// "type": "object",
/// "required": [
/// "event_type"
/// ],
/// "properties": {
/// "agent_platforms": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "description": {
/// "type": "string"
/// },
/// "event_type": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
/// }
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CatalogHooksResponse {
pub hooks: ::std::vec::Vec<CatalogHooksResponseHooksItem>,
}
impl CatalogHooksResponse {
pub fn builder() -> builder::CatalogHooksResponse {
Default::default()
}
}
///`CatalogHooksResponseHooksItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "event_type"
/// ],
/// "properties": {
/// "agent_platforms": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "description": {
/// "type": "string"
/// },
/// "event_type": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CatalogHooksResponseHooksItem {
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub agent_platforms: ::std::vec::Vec<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
pub event_type: ::std::string::String,
}
impl CatalogHooksResponseHooksItem {
pub fn builder() -> builder::CatalogHooksResponseHooksItem {
Default::default()
}
}
///HTTP request body for POST /api/v1/events/ingest sent by openlatch-client. CloudEvents v1.0.2 batch mode — a bare JSON array of EventEnvelope objects, sent with Content-Type: application/cloudevents-batch+json. Client-wide metadata (schema_version, agent_id) is carried on each CloudEvent via extension attributes rather than a wrapper object.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "CloudIngestionRequest",
/// "description": "HTTP request body for POST /api/v1/events/ingest sent by openlatch-client. CloudEvents v1.0.2 batch mode — a bare JSON array of EventEnvelope objects, sent with Content-Type: application/cloudevents-batch+json. Client-wide metadata (schema_version, agent_id) is carried on each CloudEvent via extension attributes rather than a wrapper object.",
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/EventEnvelope"
/// },
/// "maxItems": 100,
/// "minItems": 1,
/// "x-postgresql-skip": true
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CloudIngestionRequest(pub ::std::vec::Vec<EventEnvelope>);
impl ::std::ops::Deref for CloudIngestionRequest {
type Target = ::std::vec::Vec<EventEnvelope>;
fn deref(&self) -> &::std::vec::Vec<EventEnvelope> {
&self.0
}
}
impl ::std::convert::From<CloudIngestionRequest> for ::std::vec::Vec<EventEnvelope> {
fn from(value: CloudIngestionRequest) -> Self {
value.0
}
}
impl ::std::convert::From<::std::vec::Vec<EventEnvelope>> for CloudIngestionRequest {
fn from(value: ::std::vec::Vec<EventEnvelope>) -> Self {
Self(value)
}
}
///HTTP response body for POST /api/v1/events/ingest returned to openlatch-client. The client uses status to determine whether to retry, and event_id to correlate verdicts.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "CloudIngestionResponse",
/// "description": "HTTP response body for POST /api/v1/events/ingest returned to openlatch-client. The client uses status to determine whether to retry, and event_id to correlate verdicts.",
/// "type": "object",
/// "required": [
/// "status"
/// ],
/// "properties": {
/// "error": {
/// "description": "Human-readable error description. Present when status is rejected.",
/// "type": "string"
/// },
/// "event_id": {
/// "description": "Server-assigned UUIDv7 event_id for the stored event. Present when status is accepted.",
/// "type": "string"
/// },
/// "status": {
/// "description": "Ingestion outcome — accepted means persisted (or duplicate), rejected means permanently invalid.",
/// "type": "string",
/// "enum": [
/// "accepted",
/// "rejected"
/// ]
/// }
/// },
/// "additionalProperties": false,
/// "x-postgresql-skip": true
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CloudIngestionResponse {
///Human-readable error description. Present when status is rejected.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub error: ::std::option::Option<::std::string::String>,
///Server-assigned UUIDv7 event_id for the stored event. Present when status is accepted.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub event_id: ::std::option::Option<::std::string::String>,
///Ingestion outcome — accepted means persisted (or duplicate), rejected means permanently invalid.
pub status: CloudIngestionResponseStatus,
}
impl CloudIngestionResponse {
pub fn builder() -> builder::CloudIngestionResponse {
Default::default()
}
}
///Ingestion outcome — accepted means persisted (or duplicate), rejected means permanently invalid.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Ingestion outcome — accepted means persisted (or duplicate), rejected means permanently invalid.",
/// "type": "string",
/// "enum": [
/// "accepted",
/// "rejected"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum CloudIngestionResponseStatus {
#[serde(rename = "accepted")]
Accepted,
#[serde(rename = "rejected")]
Rejected,
}
impl ::std::fmt::Display for CloudIngestionResponseStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Accepted => f.write_str("accepted"),
Self::Rejected => f.write_str("rejected"),
}
}
}
impl ::std::str::FromStr for CloudIngestionResponseStatus {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"accepted" => Ok(Self::Accepted),
"rejected" => Ok(Self::Rejected),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for CloudIngestionResponseStatus {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for CloudIngestionResponseStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for CloudIngestionResponseStatus {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Body shape for PATCH /api/v1/editor/profile.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "Editor Profile (PATCH body)",
/// "description": "Body shape for PATCH /api/v1/editor/profile.",
/// "type": "object",
/// "properties": {
/// "description": {
/// "type": "string",
/// "maxLength": 1000
/// },
/// "display_name": {
/// "type": "string",
/// "maxLength": 200,
/// "minLength": 1
/// },
/// "docs_url": {
/// "type": "string",
/// "format": "uri"
/// },
/// "homepage_url": {
/// "type": "string",
/// "format": "uri"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct EditorProfile {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<EditorProfileDescription>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub display_name: ::std::option::Option<EditorProfileDisplayName>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub docs_url: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub homepage_url: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for EditorProfile {
fn default() -> Self {
Self {
description: Default::default(),
display_name: Default::default(),
docs_url: Default::default(),
homepage_url: Default::default(),
}
}
}
impl EditorProfile {
pub fn builder() -> builder::EditorProfile {
Default::default()
}
}
///`EditorProfileDescription`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "maxLength": 1000
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct EditorProfileDescription(::std::string::String);
impl ::std::ops::Deref for EditorProfileDescription {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<EditorProfileDescription> for ::std::string::String {
fn from(value: EditorProfileDescription) -> Self {
value.0
}
}
impl ::std::str::FromStr for EditorProfileDescription {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() > 1000usize {
return Err("longer than 1000 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for EditorProfileDescription {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for EditorProfileDescription {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for EditorProfileDescription {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for EditorProfileDescription {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///`EditorProfileDisplayName`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "maxLength": 200,
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct EditorProfileDisplayName(::std::string::String);
impl ::std::ops::Deref for EditorProfileDisplayName {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<EditorProfileDisplayName> for ::std::string::String {
fn from(value: EditorProfileDisplayName) -> Self {
value.0
}
}
impl ::std::str::FromStr for EditorProfileDisplayName {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() > 200usize {
return Err("longer than 200 characters".into());
}
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for EditorProfileDisplayName {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for EditorProfileDisplayName {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for EditorProfileDisplayName {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for EditorProfileDisplayName {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///Shared string types for the openlatch-client wire format. HookEventType and AgentType are OPEN strings — any string is valid. The x-known-values vocabularies are informational hints for tooling and telemetry. Verdict remains a closed enum because it is the cloud→client response surface and the client must branch exhaustively on it.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "OpenLatch Client Enums",
/// "description": "Shared string types for the openlatch-client wire format. HookEventType and AgentType are OPEN strings — any string is valid. The x-known-values vocabularies are informational hints for tooling and telemetry. Verdict remains a closed enum because it is the cloud→client response surface and the client must branch exhaustively on it.",
/// "type": "object",
/// "additionalProperties": false,
/// "x-postgresql-skip": true
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct Enums {}
impl ::std::default::Default for Enums {
fn default() -> Self {
Self {}
}
}
impl Enums {
pub fn builder() -> builder::Enums {
Default::default()
}
}
///CloudEvents v1.0.2 structured-mode envelope for agent hook events. Content-Type is application/cloudevents+json (single) or application/cloudevents-batch+json (batch). The 'data' field contains the raw agent payload untouched; all OpenLatch metadata lives in CloudEvents extension attributes. Extension attribute names MUST match ^[a-z0-9]+$ per the CloudEvents spec. verdict and latency_ms are NOT on the wire — they are produced by the daemon after processing and attached to stored events as the olverdict and ollatencyms extension attributes.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "EventEnvelope",
/// "description": "CloudEvents v1.0.2 structured-mode envelope for agent hook events. Content-Type is application/cloudevents+json (single) or application/cloudevents-batch+json (batch). The 'data' field contains the raw agent payload untouched; all OpenLatch metadata lives in CloudEvents extension attributes. Extension attribute names MUST match ^[a-z0-9]+$ per the CloudEvents spec. verdict and latency_ms are NOT on the wire — they are produced by the daemon after processing and attached to stored events as the olverdict and ollatencyms extension attributes.",
/// "type": "object",
/// "required": [
/// "id",
/// "source",
/// "specversion",
/// "time",
/// "type"
/// ],
/// "properties": {
/// "agentid": {
/// "description": "OpenLatch extension. Stamped by the daemon on outbound events — identifies the AI agent install (one openlatch-client installation) that emitted this event (agt_<uuid>).",
/// "type": "string"
/// },
/// "agentversion": {
/// "description": "OpenLatch extension (was 'agent_version'). Agent software version, if reported by the hook.",
/// "type": "string"
/// },
/// "arch": {
/// "description": "OpenLatch extension. CPU architecture ('x86_64', 'aarch64').",
/// "type": "string"
/// },
/// "clientversion": {
/// "description": "OpenLatch extension (was 'client_version'). Semver of the openlatch-client that emitted the envelope.",
/// "type": "string"
/// },
/// "data": {
/// "description": "Raw agent payload, forwarded verbatim. Shape is agent-specific (e.g. Claude Code PreToolUse emits { tool_name, tool_input, … }; Cursor beforeShellExecution emits { command, … }). OpenLatch does NOT normalise this field."
/// },
/// "datacontenttype": {
/// "description": "Media type of the 'data' field. CloudEvents core optional attribute. Fixed to application/json for all OpenLatch events.",
/// "type": "string",
/// "const": "application/json"
/// },
/// "id": {
/// "description": "Unique event identifier — UUIDv7 with 'evt_' prefix. CloudEvents core attribute.",
/// "type": "string"
/// },
/// "localipv4": {
/// "description": "OpenLatch extension (was 'local_ipv4'). Machine's local IPv4 address. Detected once at daemon startup, cached for the process lifetime. Omitted when no non-loopback interface is available.",
/// "type": "string",
/// "format": "ipv4"
/// },
/// "localipv6": {
/// "description": "OpenLatch extension (was 'local_ipv6'). Machine's local IPv6 address.",
/// "type": "string",
/// "format": "ipv6"
/// },
/// "os": {
/// "description": "OpenLatch extension. Operating system ('linux', 'macos', 'windows'). CloudEvents extension — lowercase alphanumeric attribute name.",
/// "type": "string"
/// },
/// "publicipv4": {
/// "description": "OpenLatch extension (was 'public_ipv4'). Machine's public IPv4 address.",
/// "type": "string",
/// "format": "ipv4"
/// },
/// "publicipv6": {
/// "description": "OpenLatch extension (was 'public_ipv6'). Machine's public IPv6 address.",
/// "type": "string",
/// "format": "ipv6"
/// },
/// "source": {
/// "description": "Agent platform identifier (was 'agent_platform'). CloudEvents core attribute. Bare string per OpenLatch convention; any string is valid. See x-known-values in enums.schema.json#/$defs/AgentType for the canonical set.",
/// "$ref": "#/definitions/AgentType"
/// },
/// "specversion": {
/// "description": "CloudEvents spec version. MUST be '1.0' for CloudEvents v1.0.2.",
/// "type": "string",
/// "const": "1.0"
/// },
/// "subject": {
/// "description": "CloudEvents 'subject' attribute. OpenLatch uses this for the agent session identifier (was 'session_id'). Consumers can group events by subject for per-session analytics.",
/// "type": "string"
/// },
/// "time": {
/// "description": "Event creation timestamp (was 'timestamp'). RFC 3339 UTC with Z suffix. CloudEvents core attribute.",
/// "type": "string",
/// "format": "date-time"
/// },
/// "type": {
/// "description": "Hook event lifecycle name (was 'event_type'). CloudEvents core attribute. Any string is valid. See x-known-values in enums.schema.json#/$defs/HookEventType for the canonical set.",
/// "$ref": "#/definitions/HookEventType"
/// }
/// },
/// "additionalProperties": true,
/// "x-postgresql-skip": true
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct EventEnvelope {
///OpenLatch extension. Stamped by the daemon on outbound events — identifies the AI agent install (one openlatch-client installation) that emitted this event (agt_<uuid>).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub agentid: ::std::option::Option<::std::string::String>,
///OpenLatch extension (was 'agent_version'). Agent software version, if reported by the hook.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub agentversion: ::std::option::Option<::std::string::String>,
///OpenLatch extension. CPU architecture ('x86_64', 'aarch64').
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub arch: ::std::option::Option<::std::string::String>,
///OpenLatch extension (was 'client_version'). Semver of the openlatch-client that emitted the envelope.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub clientversion: ::std::option::Option<::std::string::String>,
///Raw agent payload, forwarded verbatim. Shape is agent-specific (e.g. Claude Code PreToolUse emits { tool_name, tool_input, … }; Cursor beforeShellExecution emits { command, … }). OpenLatch does NOT normalise this field.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub data: ::std::option::Option<::serde_json::Value>,
///Media type of the 'data' field. CloudEvents core optional attribute. Fixed to application/json for all OpenLatch events.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub datacontenttype: ::std::option::Option<::std::string::String>,
///Unique event identifier — UUIDv7 with 'evt_' prefix. CloudEvents core attribute.
pub id: ::std::string::String,
///OpenLatch extension (was 'local_ipv4'). Machine's local IPv4 address. Detected once at daemon startup, cached for the process lifetime. Omitted when no non-loopback interface is available.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub localipv4: ::std::option::Option<::std::net::Ipv4Addr>,
///OpenLatch extension (was 'local_ipv6'). Machine's local IPv6 address.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub localipv6: ::std::option::Option<::std::net::Ipv6Addr>,
///OpenLatch extension. Operating system ('linux', 'macos', 'windows'). CloudEvents extension — lowercase alphanumeric attribute name.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub os: ::std::option::Option<::std::string::String>,
///OpenLatch extension (was 'public_ipv4'). Machine's public IPv4 address.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub publicipv4: ::std::option::Option<::std::net::Ipv4Addr>,
///OpenLatch extension (was 'public_ipv6'). Machine's public IPv6 address.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub publicipv6: ::std::option::Option<::std::net::Ipv6Addr>,
///Agent platform identifier (was 'agent_platform'). CloudEvents core attribute. Bare string per OpenLatch convention; any string is valid. See x-known-values in enums.schema.json#/$defs/AgentType for the canonical set.
pub source: AgentType,
///CloudEvents spec version. MUST be '1.0' for CloudEvents v1.0.2.
pub specversion: ::std::string::String,
///CloudEvents 'subject' attribute. OpenLatch uses this for the agent session identifier (was 'session_id'). Consumers can group events by subject for per-session analytics.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub subject: ::std::option::Option<::std::string::String>,
///Event creation timestamp (was 'timestamp'). RFC 3339 UTC with Z suffix. CloudEvents core attribute.
pub time: ::chrono::DateTime<::chrono::offset::Utc>,
///Hook event lifecycle name (was 'event_type'). CloudEvents core attribute. Any string is valid. See x-known-values in enums.schema.json#/$defs/HookEventType for the canonical set.
#[serde(rename = "type")]
pub type_: HookEventType,
}
impl EventEnvelope {
pub fn builder() -> builder::EventEnvelope {
Default::default()
}
}
///`HealthCheckV2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "http"
/// ],
/// "properties": {
/// "http": {
/// "type": "object",
/// "required": [
/// "port"
/// ],
/// "properties": {
/// "liveness_failure_threshold": {
/// "type": "integer",
/// "maximum": 20.0,
/// "minimum": 1.0
/// },
/// "liveness_period_ms": {
/// "type": "integer",
/// "maximum": 600000.0,
/// "minimum": 1000.0
/// },
/// "liveness_timeout_ms": {
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// },
/// "path": {
/// "type": "string",
/// "pattern": "^/"
/// },
/// "port": {
/// "type": "integer",
/// "maximum": 65535.0,
/// "minimum": 1.0
/// },
/// "startup_period_ms": {
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// },
/// "startup_timeout_ms": {
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// }
/// },
/// "additionalProperties": false
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct HealthCheckV2 {
pub http: HealthCheckV2Http,
}
impl HealthCheckV2 {
pub fn builder() -> builder::HealthCheckV2 {
Default::default()
}
}
///`HealthCheckV2Http`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "port"
/// ],
/// "properties": {
/// "liveness_failure_threshold": {
/// "type": "integer",
/// "maximum": 20.0,
/// "minimum": 1.0
/// },
/// "liveness_period_ms": {
/// "type": "integer",
/// "maximum": 600000.0,
/// "minimum": 1000.0
/// },
/// "liveness_timeout_ms": {
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// },
/// "path": {
/// "type": "string",
/// "pattern": "^/"
/// },
/// "port": {
/// "type": "integer",
/// "maximum": 65535.0,
/// "minimum": 1.0
/// },
/// "startup_period_ms": {
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// },
/// "startup_timeout_ms": {
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct HealthCheckV2Http {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub liveness_failure_threshold: ::std::option::Option<::std::num::NonZeroU64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub liveness_period_ms: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub liveness_timeout_ms: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub path: ::std::option::Option<HealthCheckV2HttpPath>,
pub port: ::std::num::NonZeroU64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub startup_period_ms: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub startup_timeout_ms: ::std::option::Option<i64>,
}
impl HealthCheckV2Http {
pub fn builder() -> builder::HealthCheckV2Http {
Default::default()
}
}
///`HealthCheckV2HttpPath`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "pattern": "^/"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct HealthCheckV2HttpPath(::std::string::String);
impl ::std::ops::Deref for HealthCheckV2HttpPath {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<HealthCheckV2HttpPath> for ::std::string::String {
fn from(value: HealthCheckV2HttpPath) -> Self {
value.0
}
}
impl ::std::str::FromStr for HealthCheckV2HttpPath {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
::std::sync::LazyLock::new(|| ::regress::Regex::new("^/").unwrap());
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^/\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for HealthCheckV2HttpPath {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for HealthCheckV2HttpPath {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for HealthCheckV2HttpPath {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for HealthCheckV2HttpPath {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///CloudEvents 'type' attribute value — the hook event lifecycle name. Client forwards any string verbatim; the list below is the canonical set recognised by current OpenLatch tooling. Unknown values are preserved and forwarded unchanged (surfaced in Rust as HookEventType::Unknown(String) via the tagged-enum lens). The per-agent x-known-values vocabulary records each agent's native event names; every listed value MUST have a matching Rust variant enforced at compile time by build.rs.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "CloudEvents 'type' attribute value — the hook event lifecycle name. Client forwards any string verbatim; the list below is the canonical set recognised by current OpenLatch tooling. Unknown values are preserved and forwarded unchanged (surfaced in Rust as HookEventType::Unknown(String) via the tagged-enum lens). The per-agent x-known-values vocabulary records each agent's native event names; every listed value MUST have a matching Rust variant enforced at compile time by build.rs.",
/// "type": "string",
/// "x-known-values": [
/// "pre_tool_use",
/// "post_tool_use",
/// "user_prompt_submit",
/// "notification",
/// "stop",
/// "subagent_stop",
/// "pre_compact",
/// "session_start",
/// "session_end"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct HookEventType(pub ::std::string::String);
impl ::std::ops::Deref for HookEventType {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<HookEventType> for ::std::string::String {
fn from(value: HookEventType) -> Self {
value.0
}
}
impl ::std::convert::From<::std::string::String> for HookEventType {
fn from(value: ::std::string::String) -> Self {
Self(value)
}
}
impl ::std::str::FromStr for HookEventType {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(Self(value.to_string()))
}
}
impl ::std::fmt::Display for HookEventType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
self.0.fmt(f)
}
}
///Top-level openlatch.yaml shape with role-keyed sections (editor, tools, providers, bindings).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "OpenLatch Provider Manifest",
/// "description": "Top-level openlatch.yaml shape with role-keyed sections (editor, tools, providers, bindings).",
/// "type": "object",
/// "required": [
/// "editor",
/// "schema_version"
/// ],
/// "properties": {
/// "bindings": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/ManifestBinding"
/// }
/// },
/// "editor": {
/// "$ref": "#/definitions/ManifestEditor"
/// },
/// "providers": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/ManifestProvider"
/// }
/// },
/// "schema_version": {
/// "description": "Manifest schema version. Currently 1.",
/// "type": "integer",
/// "const": 1
/// },
/// "tools": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/ManifestTool"
/// }
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct Manifest {
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub bindings: ::std::vec::Vec<ManifestBinding>,
pub editor: ManifestEditor,
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub providers: ::std::vec::Vec<ManifestProvider>,
///Manifest schema version. Currently 1.
pub schema_version: i64,
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub tools: ::std::vec::Vec<ManifestTool>,
}
impl Manifest {
pub fn builder() -> builder::Manifest {
Default::default()
}
}
///First-class routing unit (tool, provider, version) with per-binding endpoint and metadata.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "ToolBinding",
/// "description": "First-class routing unit (tool, provider, version) with per-binding endpoint and metadata.",
/// "type": "object",
/// "required": [
/// "capacity_qps",
/// "declared_latency_p95_ms",
/// "priority",
/// "process",
/// "provider",
/// "tool"
/// ],
/// "properties": {
/// "capacity_qps": {
/// "type": "integer",
/// "minimum": 1.0
/// },
/// "compliance": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "data_handling": {
/// "type": "object",
/// "additionalProperties": true
/// },
/// "declared_latency_p95_ms": {
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 1.0
/// },
/// "local_endpoint": {
/// "description": "(Runtime-mode only) localhost route the runtime proxies events to. E.g. http://localhost:7700/event.",
/// "type": "string"
/// },
/// "pricing": {
/// "description": "Free-form pricing metadata (per-event, per-token, tiered, ...). See routing-engine conventions.",
/// "type": "object",
/// "additionalProperties": true
/// },
/// "priority": {
/// "type": "integer",
/// "maximum": 100.0,
/// "minimum": 0.0
/// },
/// "process": {
/// "description": "Required. Managed-process specification — how the runtime daemon spawns and supervises the localhost tool that serves this binding. Local-only: stripped before publishing to the platform.",
/// "$ref": "#/definitions/ManifestProcess"
/// },
/// "provider": {
/// "description": "Slug of a provider defined in `providers[]`. The provider's `endpoint_url` is the public HTTPS ingress where the platform delivers webhooks for this binding.",
/// "type": "string"
/// },
/// "tool": {
/// "description": "Slug of a tool defined in `tools[]`.",
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ManifestBinding {
pub capacity_qps: ::std::num::NonZeroU64,
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub compliance: ::std::vec::Vec<::std::string::String>,
#[serde(default, skip_serializing_if = "::serde_json::Map::is_empty")]
pub data_handling: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
pub declared_latency_p95_ms: ::std::num::NonZeroU64,
///(Runtime-mode only) localhost route the runtime proxies events to. E.g. http://localhost:7700/event.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub local_endpoint: ::std::option::Option<::std::string::String>,
///Free-form pricing metadata (per-event, per-token, tiered, ...). See routing-engine conventions.
#[serde(default, skip_serializing_if = "::serde_json::Map::is_empty")]
pub pricing: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
pub priority: i64,
///Required. Managed-process specification — how the runtime daemon spawns and supervises the localhost tool that serves this binding. Local-only: stripped before publishing to the platform.
pub process: ManifestProcess,
///Slug of a provider defined in `providers[]`. The provider's `endpoint_url` is the public HTTPS ingress where the platform delivers webhooks for this binding.
pub provider: ::std::string::String,
///Slug of a tool defined in `tools[]`.
pub tool: ::std::string::String,
}
impl ManifestBinding {
pub fn builder() -> builder::ManifestBinding {
Default::default()
}
}
///Per-threat-category capability declaration for a Tool.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "Tool Capability",
/// "description": "Per-threat-category capability declaration for a Tool.",
/// "type": "object",
/// "required": [
/// "declared_latency_p95_ms",
/// "execution_mode",
/// "needs_raw_payload",
/// "threat_category"
/// ],
/// "properties": {
/// "declared_latency_p95_ms": {
/// "description": "Vendor's declared p95 latency for this category.",
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 1.0
/// },
/// "execution_mode": {
/// "type": "string",
/// "enum": [
/// "sync",
/// "async"
/// ]
/// },
/// "needs_prior_config_state": {
/// "description": "If true, the platform attaches prior config artifact state as the CloudEvents `priorconfigstate` extension for stateful configuration_threat / tool-integrity detectors.",
/// "type": "boolean"
/// },
/// "needs_raw_payload": {
/// "description": "If true, the platform skips built-in redactors before forwarding the event.",
/// "type": "boolean"
/// },
/// "threat_category": {
/// "type": "string",
/// "enum": [
/// "pii_outbound",
/// "pii_inbound",
/// "credential_detection",
/// "injection_tool_response",
/// "injection_user_input",
/// "shell_dangerous",
/// "shell_exfiltration",
/// "tool_hash_verification",
/// "tool_poison_detection",
/// "tool_typosquatting",
/// "attack_path_analysis",
/// "configuration_threat"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ManifestCapability {
///Vendor's declared p95 latency for this category.
pub declared_latency_p95_ms: ::std::num::NonZeroU64,
pub execution_mode: ManifestCapabilityExecutionMode,
///If true, the platform attaches prior config artifact state as the CloudEvents `priorconfigstate` extension for stateful configuration_threat / tool-integrity detectors.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub needs_prior_config_state: ::std::option::Option<bool>,
///If true, the platform skips built-in redactors before forwarding the event.
pub needs_raw_payload: bool,
pub threat_category: ManifestCapabilityThreatCategory,
}
impl ManifestCapability {
pub fn builder() -> builder::ManifestCapability {
Default::default()
}
}
///`ManifestCapabilityExecutionMode`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "sync",
/// "async"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ManifestCapabilityExecutionMode {
#[serde(rename = "sync")]
Sync,
#[serde(rename = "async")]
Async,
}
impl ::std::fmt::Display for ManifestCapabilityExecutionMode {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Sync => f.write_str("sync"),
Self::Async => f.write_str("async"),
}
}
}
impl ::std::str::FromStr for ManifestCapabilityExecutionMode {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"sync" => Ok(Self::Sync),
"async" => Ok(Self::Async),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ManifestCapabilityExecutionMode {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ManifestCapabilityExecutionMode {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ManifestCapabilityExecutionMode {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`ManifestCapabilityThreatCategory`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "pii_outbound",
/// "pii_inbound",
/// "credential_detection",
/// "injection_tool_response",
/// "injection_user_input",
/// "shell_dangerous",
/// "shell_exfiltration",
/// "tool_hash_verification",
/// "tool_poison_detection",
/// "tool_typosquatting",
/// "attack_path_analysis",
/// "configuration_threat"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ManifestCapabilityThreatCategory {
#[serde(rename = "pii_outbound")]
PiiOutbound,
#[serde(rename = "pii_inbound")]
PiiInbound,
#[serde(rename = "credential_detection")]
CredentialDetection,
#[serde(rename = "injection_tool_response")]
InjectionToolResponse,
#[serde(rename = "injection_user_input")]
InjectionUserInput,
#[serde(rename = "shell_dangerous")]
ShellDangerous,
#[serde(rename = "shell_exfiltration")]
ShellExfiltration,
#[serde(rename = "tool_hash_verification")]
ToolHashVerification,
#[serde(rename = "tool_poison_detection")]
ToolPoisonDetection,
#[serde(rename = "tool_typosquatting")]
ToolTyposquatting,
#[serde(rename = "attack_path_analysis")]
AttackPathAnalysis,
#[serde(rename = "configuration_threat")]
ConfigurationThreat,
}
impl ::std::fmt::Display for ManifestCapabilityThreatCategory {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::PiiOutbound => f.write_str("pii_outbound"),
Self::PiiInbound => f.write_str("pii_inbound"),
Self::CredentialDetection => f.write_str("credential_detection"),
Self::InjectionToolResponse => f.write_str("injection_tool_response"),
Self::InjectionUserInput => f.write_str("injection_user_input"),
Self::ShellDangerous => f.write_str("shell_dangerous"),
Self::ShellExfiltration => f.write_str("shell_exfiltration"),
Self::ToolHashVerification => f.write_str("tool_hash_verification"),
Self::ToolPoisonDetection => f.write_str("tool_poison_detection"),
Self::ToolTyposquatting => f.write_str("tool_typosquatting"),
Self::AttackPathAnalysis => f.write_str("attack_path_analysis"),
Self::ConfigurationThreat => f.write_str("configuration_threat"),
}
}
}
impl ::std::str::FromStr for ManifestCapabilityThreatCategory {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"pii_outbound" => Ok(Self::PiiOutbound),
"pii_inbound" => Ok(Self::PiiInbound),
"credential_detection" => Ok(Self::CredentialDetection),
"injection_tool_response" => Ok(Self::InjectionToolResponse),
"injection_user_input" => Ok(Self::InjectionUserInput),
"shell_dangerous" => Ok(Self::ShellDangerous),
"shell_exfiltration" => Ok(Self::ShellExfiltration),
"tool_hash_verification" => Ok(Self::ToolHashVerification),
"tool_poison_detection" => Ok(Self::ToolPoisonDetection),
"tool_typosquatting" => Ok(Self::ToolTyposquatting),
"attack_path_analysis" => Ok(Self::AttackPathAnalysis),
"configuration_threat" => Ok(Self::ConfigurationThreat),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ManifestCapabilityThreatCategory {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ManifestCapabilityThreatCategory {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ManifestCapabilityThreatCategory {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Marketplace-facing identity of the publisher entity.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "Editor profile",
/// "description": "Marketplace-facing identity of the publisher entity.",
/// "type": "object",
/// "required": [
/// "display_name",
/// "slug"
/// ],
/// "properties": {
/// "description": {
/// "type": "string",
/// "maxLength": 1000
/// },
/// "display_name": {
/// "description": "Human-readable name shown in the marketplace catalog.",
/// "type": "string",
/// "maxLength": 200,
/// "minLength": 1
/// },
/// "docs_url": {
/// "type": "string",
/// "format": "uri"
/// },
/// "homepage_url": {
/// "type": "string",
/// "format": "uri"
/// },
/// "slug": {
/// "description": "URL-safe unique slug for the editor.",
/// "type": "string",
/// "pattern": "^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ManifestEditor {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<ManifestEditorDescription>,
///Human-readable name shown in the marketplace catalog.
pub display_name: ManifestEditorDisplayName,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub docs_url: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub homepage_url: ::std::option::Option<::std::string::String>,
///URL-safe unique slug for the editor.
pub slug: ManifestEditorSlug,
}
impl ManifestEditor {
pub fn builder() -> builder::ManifestEditor {
Default::default()
}
}
///`ManifestEditorDescription`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "maxLength": 1000
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ManifestEditorDescription(::std::string::String);
impl ::std::ops::Deref for ManifestEditorDescription {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ManifestEditorDescription> for ::std::string::String {
fn from(value: ManifestEditorDescription) -> Self {
value.0
}
}
impl ::std::str::FromStr for ManifestEditorDescription {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() > 1000usize {
return Err("longer than 1000 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ManifestEditorDescription {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ManifestEditorDescription {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ManifestEditorDescription {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ManifestEditorDescription {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///Human-readable name shown in the marketplace catalog.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Human-readable name shown in the marketplace catalog.",
/// "type": "string",
/// "maxLength": 200,
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ManifestEditorDisplayName(::std::string::String);
impl ::std::ops::Deref for ManifestEditorDisplayName {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ManifestEditorDisplayName> for ::std::string::String {
fn from(value: ManifestEditorDisplayName) -> Self {
value.0
}
}
impl ::std::str::FromStr for ManifestEditorDisplayName {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() > 200usize {
return Err("longer than 200 characters".into());
}
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ManifestEditorDisplayName {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ManifestEditorDisplayName {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ManifestEditorDisplayName {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ManifestEditorDisplayName {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///URL-safe unique slug for the editor.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "URL-safe unique slug for the editor.",
/// "type": "string",
/// "pattern": "^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ManifestEditorSlug(::std::string::String);
impl ::std::ops::Deref for ManifestEditorSlug {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ManifestEditorSlug> for ::std::string::String {
fn from(value: ManifestEditorSlug) -> Self {
value.0
}
}
impl ::std::str::FromStr for ManifestEditorSlug {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
::std::sync::LazyLock::new(|| {
::regress::Regex::new("^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$").unwrap()
});
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ManifestEditorSlug {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ManifestEditorSlug {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ManifestEditorSlug {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ManifestEditorSlug {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///Per-binding managed-process specification. The runtime daemon (`openlatch-provider listen`) spawns this command at startup, supervises it (restart on crash, health probes), and tears it down on shutdown. Local-only: stripped from publish payloads to the platform.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "ManifestProcess",
/// "description": "Per-binding managed-process specification. The runtime daemon (`openlatch-provider listen`) spawns this command at startup, supervises it (restart on crash, health probes), and tears it down on shutdown. Local-only: stripped from publish payloads to the platform.",
/// "type": "object",
/// "required": [
/// "command",
/// "health_check"
/// ],
/// "properties": {
/// "command": {
/// "description": "Argv to spawn the tool. No shell expansion — argv[0] is the program, the rest are arguments. Example: [\"uv\", \"run\", \"uvicorn\", \"coinflip_tool:app\", \"--port\", \"8081\"].",
/// "type": "array",
/// "items": {
/// "type": "string",
/// "minLength": 1
/// },
/// "minItems": 1
/// },
/// "cwd": {
/// "description": "Working directory; resolved relative to the manifest file. Defaults to the manifest's directory when omitted.",
/// "type": "string"
/// },
/// "env": {
/// "description": "Extra environment variables, merged onto the parent env AFTER the OPENLATCH_*/secrets block-list strip. Keys must be strings; values are stringified.",
/// "type": "object",
/// "additionalProperties": {
/// "type": "string"
/// }
/// },
/// "health_check": {
/// "description": "How the supervisor decides the tool is up (startup probe) and stays up (liveness probe).",
/// "type": "object",
/// "required": [
/// "http"
/// ],
/// "properties": {
/// "http": {
/// "type": "object",
/// "required": [
/// "port"
/// ],
/// "properties": {
/// "liveness_failure_threshold": {
/// "description": "Consecutive liveness failures before the supervisor restarts the tool. Default 3.",
/// "type": "integer",
/// "maximum": 20.0,
/// "minimum": 1.0
/// },
/// "liveness_period_ms": {
/// "description": "Interval between liveness probes once the tool is ready. Default 10000.",
/// "type": "integer",
/// "maximum": 600000.0,
/// "minimum": 1000.0
/// },
/// "liveness_timeout_ms": {
/// "description": "Per-attempt HTTP timeout during liveness probing. Default 2000.",
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// },
/// "path": {
/// "description": "Probe path. Default /healthz.",
/// "type": "string",
/// "pattern": "^/"
/// },
/// "port": {
/// "description": "Localhost port to probe (the supervisor calls http://127.0.0.1:<port><path>).",
/// "type": "integer",
/// "maximum": 65535.0,
/// "minimum": 1.0
/// },
/// "startup_period_ms": {
/// "description": "Interval between startup-probe attempts. Default 1000.",
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// },
/// "startup_timeout_ms": {
/// "description": "Per-attempt HTTP timeout during startup probing. Default 2000.",
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// }
/// },
/// "additionalProperties": false
/// }
/// },
/// "additionalProperties": false
/// },
/// "kill_timeout_ms": {
/// "description": "Grace period after SIGTERM (Unix) / CTRL_BREAK_EVENT (Windows) before the supervisor escalates to SIGKILL / JobObject-drop. Default 5000.",
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// },
/// "restart": {
/// "description": "Restart policy. `always` (default): respawn on any exit, including clean exit 0. `on-failure`: respawn only on non-zero exit, signal kill, or liveness probe failure. `no`: never respawn.",
/// "type": "string",
/// "enum": [
/// "always",
/// "on-failure",
/// "no"
/// ]
/// },
/// "restart_policy": {
/// "description": "Rate-limit window. After `max_restarts` restarts within `window_ms`, the binding is marked degraded (OL-4303) and stops being respawned until the daemon is restarted.",
/// "type": "object",
/// "properties": {
/// "max_restarts": {
/// "description": "Default 5.",
/// "type": "integer",
/// "maximum": 100.0,
/// "minimum": 1.0
/// },
/// "window_ms": {
/// "description": "Default 60000.",
/// "type": "integer",
/// "maximum": 3600000.0,
/// "minimum": 1000.0
/// }
/// },
/// "additionalProperties": false
/// },
/// "start_timeout_ms": {
/// "description": "Total budget for the startup probe sequence (how long to wait for the tool to answer /healthz on first start). Default 30000.",
/// "type": "integer",
/// "maximum": 600000.0,
/// "minimum": 1000.0
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ManifestProcess {
///Argv to spawn the tool. No shell expansion — argv[0] is the program, the rest are arguments. Example: ["uv", "run", "uvicorn", "coinflip_tool:app", "--port", "8081"].
pub command: ::std::vec::Vec<ManifestProcessCommandItem>,
///Working directory; resolved relative to the manifest file. Defaults to the manifest's directory when omitted.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub cwd: ::std::option::Option<::std::string::String>,
///Extra environment variables, merged onto the parent env AFTER the OPENLATCH_*/secrets block-list strip. Keys must be strings; values are stringified.
#[serde(
default,
skip_serializing_if = ":: std :: collections :: HashMap::is_empty"
)]
pub env: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
pub health_check: ManifestProcessHealthCheck,
///Grace period after SIGTERM (Unix) / CTRL_BREAK_EVENT (Windows) before the supervisor escalates to SIGKILL / JobObject-drop. Default 5000.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub kill_timeout_ms: ::std::option::Option<i64>,
///Restart policy. `always` (default): respawn on any exit, including clean exit 0. `on-failure`: respawn only on non-zero exit, signal kill, or liveness probe failure. `no`: never respawn.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub restart: ::std::option::Option<ManifestProcessRestart>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub restart_policy: ::std::option::Option<ManifestProcessRestartPolicy>,
///Total budget for the startup probe sequence (how long to wait for the tool to answer /healthz on first start). Default 30000.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub start_timeout_ms: ::std::option::Option<i64>,
}
impl ManifestProcess {
pub fn builder() -> builder::ManifestProcess {
Default::default()
}
}
///`ManifestProcessCommandItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ManifestProcessCommandItem(::std::string::String);
impl ::std::ops::Deref for ManifestProcessCommandItem {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ManifestProcessCommandItem> for ::std::string::String {
fn from(value: ManifestProcessCommandItem) -> Self {
value.0
}
}
impl ::std::str::FromStr for ManifestProcessCommandItem {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ManifestProcessCommandItem {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ManifestProcessCommandItem {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ManifestProcessCommandItem {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ManifestProcessCommandItem {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///How the supervisor decides the tool is up (startup probe) and stays up (liveness probe).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "How the supervisor decides the tool is up (startup probe) and stays up (liveness probe).",
/// "type": "object",
/// "required": [
/// "http"
/// ],
/// "properties": {
/// "http": {
/// "type": "object",
/// "required": [
/// "port"
/// ],
/// "properties": {
/// "liveness_failure_threshold": {
/// "description": "Consecutive liveness failures before the supervisor restarts the tool. Default 3.",
/// "type": "integer",
/// "maximum": 20.0,
/// "minimum": 1.0
/// },
/// "liveness_period_ms": {
/// "description": "Interval between liveness probes once the tool is ready. Default 10000.",
/// "type": "integer",
/// "maximum": 600000.0,
/// "minimum": 1000.0
/// },
/// "liveness_timeout_ms": {
/// "description": "Per-attempt HTTP timeout during liveness probing. Default 2000.",
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// },
/// "path": {
/// "description": "Probe path. Default /healthz.",
/// "type": "string",
/// "pattern": "^/"
/// },
/// "port": {
/// "description": "Localhost port to probe (the supervisor calls http://127.0.0.1:<port><path>).",
/// "type": "integer",
/// "maximum": 65535.0,
/// "minimum": 1.0
/// },
/// "startup_period_ms": {
/// "description": "Interval between startup-probe attempts. Default 1000.",
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// },
/// "startup_timeout_ms": {
/// "description": "Per-attempt HTTP timeout during startup probing. Default 2000.",
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// }
/// },
/// "additionalProperties": false
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ManifestProcessHealthCheck {
pub http: ManifestProcessHealthCheckHttp,
}
impl ManifestProcessHealthCheck {
pub fn builder() -> builder::ManifestProcessHealthCheck {
Default::default()
}
}
///`ManifestProcessHealthCheckHttp`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "port"
/// ],
/// "properties": {
/// "liveness_failure_threshold": {
/// "description": "Consecutive liveness failures before the supervisor restarts the tool. Default 3.",
/// "type": "integer",
/// "maximum": 20.0,
/// "minimum": 1.0
/// },
/// "liveness_period_ms": {
/// "description": "Interval between liveness probes once the tool is ready. Default 10000.",
/// "type": "integer",
/// "maximum": 600000.0,
/// "minimum": 1000.0
/// },
/// "liveness_timeout_ms": {
/// "description": "Per-attempt HTTP timeout during liveness probing. Default 2000.",
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// },
/// "path": {
/// "description": "Probe path. Default /healthz.",
/// "type": "string",
/// "pattern": "^/"
/// },
/// "port": {
/// "description": "Localhost port to probe (the supervisor calls http://127.0.0.1:<port><path>).",
/// "type": "integer",
/// "maximum": 65535.0,
/// "minimum": 1.0
/// },
/// "startup_period_ms": {
/// "description": "Interval between startup-probe attempts. Default 1000.",
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// },
/// "startup_timeout_ms": {
/// "description": "Per-attempt HTTP timeout during startup probing. Default 2000.",
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ManifestProcessHealthCheckHttp {
///Consecutive liveness failures before the supervisor restarts the tool. Default 3.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub liveness_failure_threshold: ::std::option::Option<::std::num::NonZeroU64>,
///Interval between liveness probes once the tool is ready. Default 10000.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub liveness_period_ms: ::std::option::Option<i64>,
///Per-attempt HTTP timeout during liveness probing. Default 2000.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub liveness_timeout_ms: ::std::option::Option<i64>,
///Probe path. Default /healthz.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub path: ::std::option::Option<ManifestProcessHealthCheckHttpPath>,
///Localhost port to probe (the supervisor calls http://127.0.0.1:<port><path>).
pub port: ::std::num::NonZeroU64,
///Interval between startup-probe attempts. Default 1000.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub startup_period_ms: ::std::option::Option<i64>,
///Per-attempt HTTP timeout during startup probing. Default 2000.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub startup_timeout_ms: ::std::option::Option<i64>,
}
impl ManifestProcessHealthCheckHttp {
pub fn builder() -> builder::ManifestProcessHealthCheckHttp {
Default::default()
}
}
///Probe path. Default /healthz.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Probe path. Default /healthz.",
/// "type": "string",
/// "pattern": "^/"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ManifestProcessHealthCheckHttpPath(::std::string::String);
impl ::std::ops::Deref for ManifestProcessHealthCheckHttpPath {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ManifestProcessHealthCheckHttpPath> for ::std::string::String {
fn from(value: ManifestProcessHealthCheckHttpPath) -> Self {
value.0
}
}
impl ::std::str::FromStr for ManifestProcessHealthCheckHttpPath {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
::std::sync::LazyLock::new(|| ::regress::Regex::new("^/").unwrap());
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^/\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ManifestProcessHealthCheckHttpPath {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ManifestProcessHealthCheckHttpPath {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ManifestProcessHealthCheckHttpPath {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ManifestProcessHealthCheckHttpPath {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///Restart policy. `always` (default): respawn on any exit, including clean exit 0. `on-failure`: respawn only on non-zero exit, signal kill, or liveness probe failure. `no`: never respawn.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Restart policy. `always` (default): respawn on any exit, including clean exit 0. `on-failure`: respawn only on non-zero exit, signal kill, or liveness probe failure. `no`: never respawn.",
/// "type": "string",
/// "enum": [
/// "always",
/// "on-failure",
/// "no"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ManifestProcessRestart {
#[serde(rename = "always")]
Always,
#[serde(rename = "on-failure")]
OnFailure,
#[serde(rename = "no")]
No,
}
impl ::std::fmt::Display for ManifestProcessRestart {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Always => f.write_str("always"),
Self::OnFailure => f.write_str("on-failure"),
Self::No => f.write_str("no"),
}
}
}
impl ::std::str::FromStr for ManifestProcessRestart {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"always" => Ok(Self::Always),
"on-failure" => Ok(Self::OnFailure),
"no" => Ok(Self::No),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ManifestProcessRestart {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ManifestProcessRestart {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ManifestProcessRestart {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Rate-limit window. After `max_restarts` restarts within `window_ms`, the binding is marked degraded (OL-4303) and stops being respawned until the daemon is restarted.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Rate-limit window. After `max_restarts` restarts within `window_ms`, the binding is marked degraded (OL-4303) and stops being respawned until the daemon is restarted.",
/// "type": "object",
/// "properties": {
/// "max_restarts": {
/// "description": "Default 5.",
/// "type": "integer",
/// "maximum": 100.0,
/// "minimum": 1.0
/// },
/// "window_ms": {
/// "description": "Default 60000.",
/// "type": "integer",
/// "maximum": 3600000.0,
/// "minimum": 1000.0
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ManifestProcessRestartPolicy {
///Default 5.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_restarts: ::std::option::Option<::std::num::NonZeroU64>,
///Default 60000.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub window_ms: ::std::option::Option<i64>,
}
impl ::std::default::Default for ManifestProcessRestartPolicy {
fn default() -> Self {
Self {
max_restarts: Default::default(),
window_ms: Default::default(),
}
}
}
impl ManifestProcessRestartPolicy {
pub fn builder() -> builder::ManifestProcessRestartPolicy {
Default::default()
}
}
///Compute operator hosting one or more tool bindings.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "Provider",
/// "description": "Compute operator hosting one or more tool bindings.",
/// "type": "object",
/// "required": [
/// "display_name",
/// "endpoint_url",
/// "region",
/// "slug",
/// "total_capacity_qps"
/// ],
/// "properties": {
/// "display_name": {
/// "type": "string",
/// "maxLength": 200,
/// "minLength": 1
/// },
/// "endpoint_url": {
/// "description": "Public HTTPS URL where openlatch-platform delivers HMAC-signed webhooks. One ingress per provider; all bindings under this provider share it.",
/// "type": "string",
/// "format": "uri",
/// "pattern": "^https://"
/// },
/// "lifecycle_state": {
/// "type": "string",
/// "enum": [
/// "active",
/// "delisted"
/// ]
/// },
/// "region": {
/// "description": "Free-form region identifier (e.g. us-east-1, eu-west-1, global).",
/// "type": "string",
/// "maxLength": 64,
/// "minLength": 1
/// },
/// "slug": {
/// "type": "string",
/// "pattern": "^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$"
/// },
/// "total_capacity_qps": {
/// "type": "integer",
/// "minimum": 1.0
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ManifestProvider {
pub display_name: ManifestProviderDisplayName,
///Public HTTPS URL where openlatch-platform delivers HMAC-signed webhooks. One ingress per provider; all bindings under this provider share it.
pub endpoint_url: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub lifecycle_state: ::std::option::Option<ManifestProviderLifecycleState>,
///Free-form region identifier (e.g. us-east-1, eu-west-1, global).
pub region: ManifestProviderRegion,
pub slug: ManifestProviderSlug,
pub total_capacity_qps: ::std::num::NonZeroU64,
}
impl ManifestProvider {
pub fn builder() -> builder::ManifestProvider {
Default::default()
}
}
///`ManifestProviderDisplayName`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "maxLength": 200,
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ManifestProviderDisplayName(::std::string::String);
impl ::std::ops::Deref for ManifestProviderDisplayName {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ManifestProviderDisplayName> for ::std::string::String {
fn from(value: ManifestProviderDisplayName) -> Self {
value.0
}
}
impl ::std::str::FromStr for ManifestProviderDisplayName {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() > 200usize {
return Err("longer than 200 characters".into());
}
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ManifestProviderDisplayName {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ManifestProviderDisplayName {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ManifestProviderDisplayName {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ManifestProviderDisplayName {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///`ManifestProviderLifecycleState`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "active",
/// "delisted"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ManifestProviderLifecycleState {
#[serde(rename = "active")]
Active,
#[serde(rename = "delisted")]
Delisted,
}
impl ::std::fmt::Display for ManifestProviderLifecycleState {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Active => f.write_str("active"),
Self::Delisted => f.write_str("delisted"),
}
}
}
impl ::std::str::FromStr for ManifestProviderLifecycleState {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"active" => Ok(Self::Active),
"delisted" => Ok(Self::Delisted),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ManifestProviderLifecycleState {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ManifestProviderLifecycleState {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ManifestProviderLifecycleState {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Free-form region identifier (e.g. us-east-1, eu-west-1, global).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Free-form region identifier (e.g. us-east-1, eu-west-1, global).",
/// "type": "string",
/// "maxLength": 64,
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ManifestProviderRegion(::std::string::String);
impl ::std::ops::Deref for ManifestProviderRegion {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ManifestProviderRegion> for ::std::string::String {
fn from(value: ManifestProviderRegion) -> Self {
value.0
}
}
impl ::std::str::FromStr for ManifestProviderRegion {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() > 64usize {
return Err("longer than 64 characters".into());
}
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ManifestProviderRegion {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ManifestProviderRegion {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ManifestProviderRegion {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ManifestProviderRegion {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///`ManifestProviderSlug`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "pattern": "^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ManifestProviderSlug(::std::string::String);
impl ::std::ops::Deref for ManifestProviderSlug {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ManifestProviderSlug> for ::std::string::String {
fn from(value: ManifestProviderSlug) -> Self {
value.0
}
}
impl ::std::str::FromStr for ManifestProviderSlug {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
::std::sync::LazyLock::new(|| {
::regress::Regex::new("^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$").unwrap()
});
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ManifestProviderSlug {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ManifestProviderSlug {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ManifestProviderSlug {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ManifestProviderSlug {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///v2 provider manifest (kind: Provider) — operator-owned. Composes one or more tool manifests via `tool_paths:` globs, declares the provider's public ingress(es), and wires per-binding process overrides on top of each tool's author defaults.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "ManifestProviderV2",
/// "description": "v2 provider manifest (kind: Provider) — operator-owned. Composes one or more tool manifests via `tool_paths:` globs, declares the provider's public ingress(es), and wires per-binding process overrides on top of each tool's author defaults.",
/// "type": "object",
/// "required": [
/// "bindings",
/// "kind",
/// "providers",
/// "schema_version"
/// ],
/// "properties": {
/// "bindings": {
/// "type": "array",
/// "items": {
/// "$ref": "#/$defs/BindingV2"
/// }
/// },
/// "kind": {
/// "description": "Discriminator. Must be the literal `Provider`.",
/// "type": "string",
/// "const": "Provider"
/// },
/// "providers": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/ManifestProvider"
/// }
/// },
/// "schema_version": {
/// "description": "Manifest schema version. Must be 2.",
/// "type": "integer",
/// "const": 2
/// },
/// "tool_paths": {
/// "description": "Glob patterns expanded relative to the provider manifest's directory. Each match is loaded as a `kind: Tool` manifest.",
/// "type": "array",
/// "items": {
/// "type": "string",
/// "minLength": 1
/// }
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ManifestProviderV2 {
pub bindings: ::std::vec::Vec<BindingV2>,
///Discriminator. Must be the literal `Provider`.
pub kind: ::std::string::String,
pub providers: ::std::vec::Vec<ManifestProvider>,
///Manifest schema version. Must be 2.
pub schema_version: i64,
///Glob patterns expanded relative to the provider manifest's directory. Each match is loaded as a `kind: Tool` manifest.
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub tool_paths: ::std::vec::Vec<ManifestProviderV2ToolPathsItem>,
}
impl ManifestProviderV2 {
pub fn builder() -> builder::ManifestProviderV2 {
Default::default()
}
}
///`ManifestProviderV2ToolPathsItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ManifestProviderV2ToolPathsItem(::std::string::String);
impl ::std::ops::Deref for ManifestProviderV2ToolPathsItem {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ManifestProviderV2ToolPathsItem> for ::std::string::String {
fn from(value: ManifestProviderV2ToolPathsItem) -> Self {
value.0
}
}
impl ::std::str::FromStr for ManifestProviderV2ToolPathsItem {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ManifestProviderV2ToolPathsItem {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ManifestProviderV2ToolPathsItem {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ManifestProviderV2ToolPathsItem {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ManifestProviderV2ToolPathsItem {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///Logical security tool. One active version per slug.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "Tool",
/// "description": "Logical security tool. One active version per slug.",
/// "type": "object",
/// "required": [
/// "agents_supported",
/// "capabilities",
/// "description",
/// "hooks_supported",
/// "license",
/// "slug",
/// "version"
/// ],
/// "properties": {
/// "agents_supported": {
/// "description": "Open string list of agent platforms this tool supports.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// },
/// "minItems": 1
/// },
/// "capabilities": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/ManifestCapability"
/// },
/// "minItems": 1
/// },
/// "description": {
/// "type": "string",
/// "maxLength": 1000,
/// "minLength": 1
/// },
/// "hooks_supported": {
/// "description": "Open string list of hook event types this tool subscribes to.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// },
/// "minItems": 1
/// },
/// "license": {
/// "type": "string",
/// "enum": [
/// "apache-2.0",
/// "mit",
/// "bsd-3-clause",
/// "isc",
/// "bsl-1.1",
/// "proprietary"
/// ]
/// },
/// "lifecycle_state": {
/// "type": "string",
/// "enum": [
/// "active",
/// "delisted"
/// ]
/// },
/// "slug": {
/// "type": "string",
/// "pattern": "^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$"
/// },
/// "version": {
/// "description": "SemVer 2.0 string.",
/// "type": "string",
/// "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ManifestTool {
///Open string list of agent platforms this tool supports.
pub agents_supported: ::std::vec::Vec<::std::string::String>,
pub capabilities: ::std::vec::Vec<ManifestCapability>,
pub description: ManifestToolDescription,
///Open string list of hook event types this tool subscribes to.
pub hooks_supported: ::std::vec::Vec<::std::string::String>,
pub license: ManifestToolLicense,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub lifecycle_state: ::std::option::Option<ManifestToolLifecycleState>,
pub slug: ManifestToolSlug,
///SemVer 2.0 string.
pub version: ManifestToolVersion,
}
impl ManifestTool {
pub fn builder() -> builder::ManifestTool {
Default::default()
}
}
///`ManifestToolDescription`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "maxLength": 1000,
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ManifestToolDescription(::std::string::String);
impl ::std::ops::Deref for ManifestToolDescription {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ManifestToolDescription> for ::std::string::String {
fn from(value: ManifestToolDescription) -> Self {
value.0
}
}
impl ::std::str::FromStr for ManifestToolDescription {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() > 1000usize {
return Err("longer than 1000 characters".into());
}
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ManifestToolDescription {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ManifestToolDescription {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ManifestToolDescription {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ManifestToolDescription {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///`ManifestToolLicense`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "apache-2.0",
/// "mit",
/// "bsd-3-clause",
/// "isc",
/// "bsl-1.1",
/// "proprietary"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ManifestToolLicense {
#[serde(rename = "apache-2.0")]
Apache20,
#[serde(rename = "mit")]
Mit,
#[serde(rename = "bsd-3-clause")]
Bsd3Clause,
#[serde(rename = "isc")]
Isc,
#[serde(rename = "bsl-1.1")]
Bsl11,
#[serde(rename = "proprietary")]
Proprietary,
}
impl ::std::fmt::Display for ManifestToolLicense {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Apache20 => f.write_str("apache-2.0"),
Self::Mit => f.write_str("mit"),
Self::Bsd3Clause => f.write_str("bsd-3-clause"),
Self::Isc => f.write_str("isc"),
Self::Bsl11 => f.write_str("bsl-1.1"),
Self::Proprietary => f.write_str("proprietary"),
}
}
}
impl ::std::str::FromStr for ManifestToolLicense {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"apache-2.0" => Ok(Self::Apache20),
"mit" => Ok(Self::Mit),
"bsd-3-clause" => Ok(Self::Bsd3Clause),
"isc" => Ok(Self::Isc),
"bsl-1.1" => Ok(Self::Bsl11),
"proprietary" => Ok(Self::Proprietary),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ManifestToolLicense {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ManifestToolLicense {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ManifestToolLicense {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`ManifestToolLifecycleState`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "active",
/// "delisted"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ManifestToolLifecycleState {
#[serde(rename = "active")]
Active,
#[serde(rename = "delisted")]
Delisted,
}
impl ::std::fmt::Display for ManifestToolLifecycleState {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Active => f.write_str("active"),
Self::Delisted => f.write_str("delisted"),
}
}
}
impl ::std::str::FromStr for ManifestToolLifecycleState {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"active" => Ok(Self::Active),
"delisted" => Ok(Self::Delisted),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ManifestToolLifecycleState {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ManifestToolLifecycleState {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ManifestToolLifecycleState {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`ManifestToolSlug`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "pattern": "^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ManifestToolSlug(::std::string::String);
impl ::std::ops::Deref for ManifestToolSlug {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ManifestToolSlug> for ::std::string::String {
fn from(value: ManifestToolSlug) -> Self {
value.0
}
}
impl ::std::str::FromStr for ManifestToolSlug {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
::std::sync::LazyLock::new(|| {
::regress::Regex::new("^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$").unwrap()
});
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ManifestToolSlug {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ManifestToolSlug {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ManifestToolSlug {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ManifestToolSlug {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///v2 tool manifest (kind: Tool) — author-owned. Travels with the tool source. Contains the editor profile and one-or-more tool definitions, each carrying its own default `process:` block. One editor per tool manifest is the rule (forbidden multi-editor enforced via OL-4328).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "ManifestToolV2",
/// "description": "v2 tool manifest (kind: Tool) — author-owned. Travels with the tool source. Contains the editor profile and one-or-more tool definitions, each carrying its own default `process:` block. One editor per tool manifest is the rule (forbidden multi-editor enforced via OL-4328).",
/// "type": "object",
/// "required": [
/// "editor",
/// "kind",
/// "schema_version",
/// "tools"
/// ],
/// "properties": {
/// "editor": {
/// "$ref": "#/definitions/ManifestEditor"
/// },
/// "kind": {
/// "description": "Discriminator. Must be the literal `Tool`.",
/// "type": "string",
/// "const": "Tool"
/// },
/// "schema_version": {
/// "description": "Manifest schema version. Must be 2.",
/// "type": "integer",
/// "const": 2
/// },
/// "tools": {
/// "description": "One or more tools owned by this editor. Each tool carries its own default process block.",
/// "type": "array",
/// "items": {
/// "$ref": "#/$defs/ToolItemV2"
/// },
/// "minItems": 1
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ManifestToolV2 {
pub editor: ManifestEditor,
///Discriminator. Must be the literal `Tool`.
pub kind: ::std::string::String,
///Manifest schema version. Must be 2.
pub schema_version: i64,
///One or more tools owned by this editor. Each tool carries its own default process block.
pub tools: ::std::vec::Vec<ToolItemV2>,
}
impl ManifestToolV2 {
pub fn builder() -> builder::ManifestToolV2 {
Default::default()
}
}
///SemVer 2.0 string.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "SemVer 2.0 string.",
/// "type": "string",
/// "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ManifestToolVersion(::std::string::String);
impl ::std::ops::Deref for ManifestToolVersion {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ManifestToolVersion> for ::std::string::String {
fn from(value: ManifestToolVersion) -> Self {
value.0
}
}
impl ::std::str::FromStr for ManifestToolVersion {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(
|| {
::regress::Regex::new(
"^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$",
)
.unwrap()
},
);
if PATTERN.find(value).is_none() {
return Err(
"doesn't match pattern \"^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$\""
.into(),
);
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ManifestToolVersion {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ManifestToolVersion {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ManifestToolVersion {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ManifestToolVersion {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///`OpenLatchProviderBundle`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "OpenLatchProviderBundle",
/// "type": "object"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct OpenLatchProviderBundle(
pub ::serde_json::Map<::std::string::String, ::serde_json::Value>,
);
impl ::std::ops::Deref for OpenLatchProviderBundle {
type Target = ::serde_json::Map<::std::string::String, ::serde_json::Value>;
fn deref(&self) -> &::serde_json::Map<::std::string::String, ::serde_json::Value> {
&self.0
}
}
impl ::std::convert::From<OpenLatchProviderBundle>
for ::serde_json::Map<::std::string::String, ::serde_json::Value>
{
fn from(value: OpenLatchProviderBundle) -> Self {
value.0
}
}
impl ::std::convert::From<::serde_json::Map<::std::string::String, ::serde_json::Value>>
for OpenLatchProviderBundle
{
fn from(value: ::serde_json::Map<::std::string::String, ::serde_json::Value>) -> Self {
Self(value)
}
}
///`ProcessOverrideV2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "command": {
/// "description": "If set, replaces the tool default's command verbatim.",
/// "type": "array",
/// "items": {
/// "type": "string",
/// "minLength": 1
/// }
/// },
/// "command_args": {
/// "description": "If set, appended to the tool default's command. Mutually exclusive with `command`.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "cwd": {
/// "type": "string"
/// },
/// "env": {
/// "type": "object",
/// "additionalProperties": {
/// "type": "string"
/// }
/// },
/// "health_check": {
/// "type": "object",
/// "required": [
/// "http"
/// ],
/// "properties": {
/// "http": {
/// "type": "object",
/// "required": [
/// "port"
/// ],
/// "properties": {
/// "liveness_failure_threshold": {
/// "type": "integer",
/// "maximum": 20.0,
/// "minimum": 1.0
/// },
/// "liveness_period_ms": {
/// "type": "integer",
/// "maximum": 600000.0,
/// "minimum": 1000.0
/// },
/// "liveness_timeout_ms": {
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// },
/// "path": {
/// "type": "string",
/// "pattern": "^/"
/// },
/// "port": {
/// "type": "integer",
/// "maximum": 65535.0,
/// "minimum": 1.0
/// },
/// "startup_period_ms": {
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// },
/// "startup_timeout_ms": {
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// }
/// },
/// "additionalProperties": false
/// }
/// },
/// "additionalProperties": false
/// },
/// "restart": {
/// "type": "object",
/// "properties": {
/// "max_restarts": {
/// "type": "integer",
/// "maximum": 100.0,
/// "minimum": 1.0
/// },
/// "window_seconds": {
/// "type": "integer",
/// "maximum": 3600.0,
/// "minimum": 1.0
/// }
/// },
/// "additionalProperties": false
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ProcessOverrideV2 {
///If set, replaces the tool default's command verbatim.
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub command: ::std::vec::Vec<ProcessOverrideV2CommandItem>,
///If set, appended to the tool default's command. Mutually exclusive with `command`.
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub command_args: ::std::vec::Vec<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub cwd: ::std::option::Option<::std::string::String>,
#[serde(
default,
skip_serializing_if = ":: std :: collections :: HashMap::is_empty"
)]
pub env: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub health_check: ::std::option::Option<ProcessOverrideV2HealthCheck>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub restart: ::std::option::Option<ProcessOverrideV2Restart>,
}
impl ::std::default::Default for ProcessOverrideV2 {
fn default() -> Self {
Self {
command: Default::default(),
command_args: Default::default(),
cwd: Default::default(),
env: Default::default(),
health_check: Default::default(),
restart: Default::default(),
}
}
}
impl ProcessOverrideV2 {
pub fn builder() -> builder::ProcessOverrideV2 {
Default::default()
}
}
///`ProcessOverrideV2CommandItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ProcessOverrideV2CommandItem(::std::string::String);
impl ::std::ops::Deref for ProcessOverrideV2CommandItem {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ProcessOverrideV2CommandItem> for ::std::string::String {
fn from(value: ProcessOverrideV2CommandItem) -> Self {
value.0
}
}
impl ::std::str::FromStr for ProcessOverrideV2CommandItem {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ProcessOverrideV2CommandItem {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ProcessOverrideV2CommandItem {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ProcessOverrideV2CommandItem {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ProcessOverrideV2CommandItem {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///`ProcessOverrideV2HealthCheck`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "http"
/// ],
/// "properties": {
/// "http": {
/// "type": "object",
/// "required": [
/// "port"
/// ],
/// "properties": {
/// "liveness_failure_threshold": {
/// "type": "integer",
/// "maximum": 20.0,
/// "minimum": 1.0
/// },
/// "liveness_period_ms": {
/// "type": "integer",
/// "maximum": 600000.0,
/// "minimum": 1000.0
/// },
/// "liveness_timeout_ms": {
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// },
/// "path": {
/// "type": "string",
/// "pattern": "^/"
/// },
/// "port": {
/// "type": "integer",
/// "maximum": 65535.0,
/// "minimum": 1.0
/// },
/// "startup_period_ms": {
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// },
/// "startup_timeout_ms": {
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// }
/// },
/// "additionalProperties": false
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ProcessOverrideV2HealthCheck {
pub http: ProcessOverrideV2HealthCheckHttp,
}
impl ProcessOverrideV2HealthCheck {
pub fn builder() -> builder::ProcessOverrideV2HealthCheck {
Default::default()
}
}
///`ProcessOverrideV2HealthCheckHttp`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "port"
/// ],
/// "properties": {
/// "liveness_failure_threshold": {
/// "type": "integer",
/// "maximum": 20.0,
/// "minimum": 1.0
/// },
/// "liveness_period_ms": {
/// "type": "integer",
/// "maximum": 600000.0,
/// "minimum": 1000.0
/// },
/// "liveness_timeout_ms": {
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// },
/// "path": {
/// "type": "string",
/// "pattern": "^/"
/// },
/// "port": {
/// "type": "integer",
/// "maximum": 65535.0,
/// "minimum": 1.0
/// },
/// "startup_period_ms": {
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// },
/// "startup_timeout_ms": {
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ProcessOverrideV2HealthCheckHttp {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub liveness_failure_threshold: ::std::option::Option<::std::num::NonZeroU64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub liveness_period_ms: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub liveness_timeout_ms: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub path: ::std::option::Option<ProcessOverrideV2HealthCheckHttpPath>,
pub port: ::std::num::NonZeroU64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub startup_period_ms: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub startup_timeout_ms: ::std::option::Option<i64>,
}
impl ProcessOverrideV2HealthCheckHttp {
pub fn builder() -> builder::ProcessOverrideV2HealthCheckHttp {
Default::default()
}
}
///`ProcessOverrideV2HealthCheckHttpPath`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "pattern": "^/"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ProcessOverrideV2HealthCheckHttpPath(::std::string::String);
impl ::std::ops::Deref for ProcessOverrideV2HealthCheckHttpPath {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ProcessOverrideV2HealthCheckHttpPath> for ::std::string::String {
fn from(value: ProcessOverrideV2HealthCheckHttpPath) -> Self {
value.0
}
}
impl ::std::str::FromStr for ProcessOverrideV2HealthCheckHttpPath {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
::std::sync::LazyLock::new(|| ::regress::Regex::new("^/").unwrap());
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^/\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ProcessOverrideV2HealthCheckHttpPath {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ProcessOverrideV2HealthCheckHttpPath {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ProcessOverrideV2HealthCheckHttpPath {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ProcessOverrideV2HealthCheckHttpPath {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///`ProcessOverrideV2Restart`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "max_restarts": {
/// "type": "integer",
/// "maximum": 100.0,
/// "minimum": 1.0
/// },
/// "window_seconds": {
/// "type": "integer",
/// "maximum": 3600.0,
/// "minimum": 1.0
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ProcessOverrideV2Restart {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_restarts: ::std::option::Option<::std::num::NonZeroU64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub window_seconds: ::std::option::Option<::std::num::NonZeroU64>,
}
impl ::std::default::Default for ProcessOverrideV2Restart {
fn default() -> Self {
Self {
max_restarts: Default::default(),
window_seconds: Default::default(),
}
}
}
impl ProcessOverrideV2Restart {
pub fn builder() -> builder::ProcessOverrideV2Restart {
Default::default()
}
}
///v2 default process block (lives on the tool item, not the binding). Sibling shape of `manifest-process.schema.json` with v2-specific `restart` object.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "v2 default process block (lives on the tool item, not the binding). Sibling shape of `manifest-process.schema.json` with v2-specific `restart` object.",
/// "type": "object",
/// "required": [
/// "command",
/// "health_check"
/// ],
/// "properties": {
/// "command": {
/// "description": "Argv to spawn the tool.",
/// "type": "array",
/// "items": {
/// "type": "string",
/// "minLength": 1
/// },
/// "minItems": 1
/// },
/// "cwd": {
/// "description": "Working directory; resolved relative to the tool manifest's directory.",
/// "type": "string"
/// },
/// "env": {
/// "type": "object",
/// "additionalProperties": {
/// "type": "string"
/// }
/// },
/// "health_check": {
/// "$ref": "#/$defs/HealthCheckV2"
/// },
/// "kill_timeout_ms": {
/// "type": "integer",
/// "maximum": 60000.0,
/// "minimum": 100.0
/// },
/// "restart": {
/// "$ref": "#/$defs/RestartLimitV2"
/// },
/// "start_timeout_ms": {
/// "type": "integer",
/// "maximum": 600000.0,
/// "minimum": 1000.0
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ProcessV2 {
///Argv to spawn the tool.
pub command: ::std::vec::Vec<ProcessV2CommandItem>,
///Working directory; resolved relative to the tool manifest's directory.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub cwd: ::std::option::Option<::std::string::String>,
#[serde(
default,
skip_serializing_if = ":: std :: collections :: HashMap::is_empty"
)]
pub env: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
pub health_check: HealthCheckV2,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub kill_timeout_ms: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub restart: ::std::option::Option<RestartLimitV2>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub start_timeout_ms: ::std::option::Option<i64>,
}
impl ProcessV2 {
pub fn builder() -> builder::ProcessV2 {
Default::default()
}
}
///`ProcessV2CommandItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ProcessV2CommandItem(::std::string::String);
impl ::std::ops::Deref for ProcessV2CommandItem {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ProcessV2CommandItem> for ::std::string::String {
fn from(value: ProcessV2CommandItem) -> Self {
value.0
}
}
impl ::std::str::FromStr for ProcessV2CommandItem {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ProcessV2CommandItem {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ProcessV2CommandItem {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ProcessV2CommandItem {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ProcessV2CommandItem {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///Rate-limit window. After `max_restarts` within `window_seconds`, the binding is marked degraded (OL-4303).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Rate-limit window. After `max_restarts` within `window_seconds`, the binding is marked degraded (OL-4303).",
/// "type": "object",
/// "properties": {
/// "max_restarts": {
/// "type": "integer",
/// "maximum": 100.0,
/// "minimum": 1.0
/// },
/// "window_seconds": {
/// "type": "integer",
/// "maximum": 3600.0,
/// "minimum": 1.0
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct RestartLimitV2 {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_restarts: ::std::option::Option<::std::num::NonZeroU64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub window_seconds: ::std::option::Option<::std::num::NonZeroU64>,
}
impl ::std::default::Default for RestartLimitV2 {
fn default() -> Self {
Self {
max_restarts: Default::default(),
window_seconds: Default::default(),
}
}
}
impl RestartLimitV2 {
pub fn builder() -> builder::RestartLimitV2 {
Default::default()
}
}
///`ToolItemV2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "agents_supported",
/// "capabilities",
/// "description",
/// "hooks_supported",
/// "license",
/// "process",
/// "slug",
/// "version"
/// ],
/// "properties": {
/// "agents_supported": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// },
/// "minItems": 1
/// },
/// "capabilities": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/ManifestCapability"
/// },
/// "minItems": 1
/// },
/// "description": {
/// "type": "string",
/// "maxLength": 1000,
/// "minLength": 1
/// },
/// "hooks_supported": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// },
/// "minItems": 1
/// },
/// "license": {
/// "type": "string",
/// "enum": [
/// "apache-2.0",
/// "mit",
/// "bsd-3-clause",
/// "isc",
/// "bsl-1.1",
/// "proprietary"
/// ]
/// },
/// "lifecycle_state": {
/// "type": "string",
/// "enum": [
/// "active",
/// "delisted"
/// ]
/// },
/// "process": {
/// "description": "Author's default supervised-process spec. The operator can layer `process_override:` on top from the provider manifest's bindings[].",
/// "$ref": "#/$defs/ProcessV2"
/// },
/// "slug": {
/// "type": "string",
/// "pattern": "^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$"
/// },
/// "version": {
/// "description": "SemVer 2.0 string.",
/// "type": "string",
/// "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ToolItemV2 {
pub agents_supported: ::std::vec::Vec<::std::string::String>,
pub capabilities: ::std::vec::Vec<ManifestCapability>,
pub description: ToolItemV2Description,
pub hooks_supported: ::std::vec::Vec<::std::string::String>,
pub license: ToolItemV2License,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub lifecycle_state: ::std::option::Option<ToolItemV2LifecycleState>,
///Author's default supervised-process spec. The operator can layer `process_override:` on top from the provider manifest's bindings[].
pub process: ProcessV2,
pub slug: ToolItemV2Slug,
///SemVer 2.0 string.
pub version: ToolItemV2Version,
}
impl ToolItemV2 {
pub fn builder() -> builder::ToolItemV2 {
Default::default()
}
}
///`ToolItemV2Description`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "maxLength": 1000,
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ToolItemV2Description(::std::string::String);
impl ::std::ops::Deref for ToolItemV2Description {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ToolItemV2Description> for ::std::string::String {
fn from(value: ToolItemV2Description) -> Self {
value.0
}
}
impl ::std::str::FromStr for ToolItemV2Description {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() > 1000usize {
return Err("longer than 1000 characters".into());
}
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ToolItemV2Description {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ToolItemV2Description {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ToolItemV2Description {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ToolItemV2Description {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///`ToolItemV2License`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "apache-2.0",
/// "mit",
/// "bsd-3-clause",
/// "isc",
/// "bsl-1.1",
/// "proprietary"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ToolItemV2License {
#[serde(rename = "apache-2.0")]
Apache20,
#[serde(rename = "mit")]
Mit,
#[serde(rename = "bsd-3-clause")]
Bsd3Clause,
#[serde(rename = "isc")]
Isc,
#[serde(rename = "bsl-1.1")]
Bsl11,
#[serde(rename = "proprietary")]
Proprietary,
}
impl ::std::fmt::Display for ToolItemV2License {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Apache20 => f.write_str("apache-2.0"),
Self::Mit => f.write_str("mit"),
Self::Bsd3Clause => f.write_str("bsd-3-clause"),
Self::Isc => f.write_str("isc"),
Self::Bsl11 => f.write_str("bsl-1.1"),
Self::Proprietary => f.write_str("proprietary"),
}
}
}
impl ::std::str::FromStr for ToolItemV2License {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"apache-2.0" => Ok(Self::Apache20),
"mit" => Ok(Self::Mit),
"bsd-3-clause" => Ok(Self::Bsd3Clause),
"isc" => Ok(Self::Isc),
"bsl-1.1" => Ok(Self::Bsl11),
"proprietary" => Ok(Self::Proprietary),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ToolItemV2License {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ToolItemV2License {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ToolItemV2License {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`ToolItemV2LifecycleState`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "active",
/// "delisted"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ToolItemV2LifecycleState {
#[serde(rename = "active")]
Active,
#[serde(rename = "delisted")]
Delisted,
}
impl ::std::fmt::Display for ToolItemV2LifecycleState {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Active => f.write_str("active"),
Self::Delisted => f.write_str("delisted"),
}
}
}
impl ::std::str::FromStr for ToolItemV2LifecycleState {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"active" => Ok(Self::Active),
"delisted" => Ok(Self::Delisted),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ToolItemV2LifecycleState {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ToolItemV2LifecycleState {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ToolItemV2LifecycleState {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`ToolItemV2Slug`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "pattern": "^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ToolItemV2Slug(::std::string::String);
impl ::std::ops::Deref for ToolItemV2Slug {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ToolItemV2Slug> for ::std::string::String {
fn from(value: ToolItemV2Slug) -> Self {
value.0
}
}
impl ::std::str::FromStr for ToolItemV2Slug {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
::std::sync::LazyLock::new(|| {
::regress::Regex::new("^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$").unwrap()
});
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ToolItemV2Slug {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ToolItemV2Slug {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ToolItemV2Slug {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ToolItemV2Slug {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///SemVer 2.0 string.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "SemVer 2.0 string.",
/// "type": "string",
/// "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ToolItemV2Version(::std::string::String);
impl ::std::ops::Deref for ToolItemV2Version {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ToolItemV2Version> for ::std::string::String {
fn from(value: ToolItemV2Version) -> Self {
value.0
}
}
impl ::std::str::FromStr for ToolItemV2Version {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(
|| {
::regress::Regex::new(
"^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$",
)
.unwrap()
},
);
if PATTERN.find(value).is_none() {
return Err(
"doesn't match pattern \"^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$\""
.into(),
);
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ToolItemV2Version {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ToolItemV2Version {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ToolItemV2Version {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ToolItemV2Version {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///Verdict returned to the agent hook. Closed enum — client must handle all three variants exhaustively. allow = proceed normally, approve = user-confirmed allow, deny = blocked.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Verdict returned to the agent hook. Closed enum — client must handle all three variants exhaustively. allow = proceed normally, approve = user-confirmed allow, deny = blocked.",
/// "type": "string",
/// "enum": [
/// "allow",
/// "approve",
/// "deny"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum Verdict {
#[serde(rename = "allow")]
Allow,
#[serde(rename = "approve")]
Approve,
#[serde(rename = "deny")]
Deny,
}
impl ::std::fmt::Display for Verdict {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Allow => f.write_str("allow"),
Self::Approve => f.write_str("approve"),
Self::Deny => f.write_str("deny"),
}
}
}
impl ::std::str::FromStr for Verdict {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"allow" => Ok(Self::Allow),
"approve" => Ok(Self::Approve),
"deny" => Ok(Self::Deny),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for Verdict {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for Verdict {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for Verdict {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Verdict response returned to the agent hook after processing. The client passes this through to the agent hook without interpreting the verdict itself. Mirrors the cloud response schema. Schema version '1.1' adds the optional 'context' object (headline / body / evidence[]) carrying user-facing copy that the agent renders in its end-user notification (D-16 of OpenRouter of Security).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "VerdictResponse",
/// "description": "Verdict response returned to the agent hook after processing. The client passes this through to the agent hook without interpreting the verdict itself. Mirrors the cloud response schema. Schema version '1.1' adds the optional 'context' object (headline / body / evidence[]) carrying user-facing copy that the agent renders in its end-user notification (D-16 of OpenRouter of Security).",
/// "type": "object",
/// "required": [
/// "event_id",
/// "latency_ms",
/// "schema_version",
/// "verdict"
/// ],
/// "properties": {
/// "context": {
/// "description": "Schema 1.1+. Optional user-facing copy for rendering an end-user-visible notification when the verdict is rendered to the human. Clients render context.headline + context.body + context.evidence directly. 'remediation' is intentionally NOT on the wire (D-16) — it is stored on the platform and accessible via details_url. Older clients (1.0) ignore this field.",
/// "type": [
/// "object",
/// "null"
/// ],
/// "required": [
/// "body",
/// "headline"
/// ],
/// "properties": {
/// "body": {
/// "description": "One-paragraph explanation shown below the headline.",
/// "type": "string",
/// "maxLength": 500,
/// "minLength": 1
/// },
/// "evidence": {
/// "type": "array",
/// "items": {
/// "type": "object",
/// "required": [
/// "label"
/// ],
/// "properties": {
/// "label": {
/// "description": "Short tag, e.g. 'credit_card', 'host', 'tool_name'.",
/// "type": "string",
/// "maxLength": 64,
/// "minLength": 1
/// },
/// "value_redacted": {
/// "description": "Redacted display string. Provider redacts before submission; platform re-runs SENSITIVE_FIELD_PATTERNS defensively.",
/// "type": "string",
/// "maxLength": 200
/// }
/// },
/// "additionalProperties": false
/// },
/// "maxItems": 16
/// },
/// "headline": {
/// "description": "One-line summary shown as the toast / notification title.",
/// "type": "string",
/// "maxLength": 120,
/// "minLength": 1
/// }
/// },
/// "additionalProperties": false
/// },
/// "details_url": {
/// "description": "URL to the OpenLatch dashboard with detailed event analysis. Omitted when not available.",
/// "type": "string"
/// },
/// "event_id": {
/// "description": "Server-assigned or client-generated ID of the event this verdict responds to.",
/// "type": "string"
/// },
/// "latency_ms": {
/// "description": "Total end-to-end processing latency in milliseconds, including cloud round-trip when applicable.",
/// "type": "number",
/// "minimum": 0.0
/// },
/// "offline": {
/// "description": "Schema 1.1+. True when all configured security tools were unreachable. The verdict is fail-open ('allow') and 'context.headline' will read 'Security tools unreachable'. Older clients ignore this field.",
/// "type": "boolean"
/// },
/// "reason": {
/// "description": "Human-readable explanation for the verdict. Omitted for allow verdicts.",
/// "type": "string"
/// },
/// "rule_id": {
/// "description": "Identifier of the detection rule that triggered this verdict. Omitted when no rule matched.",
/// "type": "string"
/// },
/// "schema_version": {
/// "description": "Schema version for forward compatibility. '1.0' = legacy. '1.1' = adds optional 'context' + 'offline' fields (D-16 of OpenRouter of Security). Older clients ignore unknown fields and remain compatible.",
/// "type": "string"
/// },
/// "severity": {
/// "description": "Threat severity level (e.g., 'critical', 'high', 'medium', 'low'). Omitted when no threat was detected.",
/// "type": "string"
/// },
/// "threat_category": {
/// "description": "Category of detected threat (e.g., 'credential_exfiltration', 'command_injection'). Omitted when no threat detected.",
/// "type": "string"
/// },
/// "verdict": {
/// "description": "The verdict: allow = proceed, approve = user-confirmed allow, deny = blocked.",
/// "$ref": "#/definitions/Verdict"
/// }
/// },
/// "additionalProperties": false,
/// "x-postgresql-skip": true
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct VerdictResponse {
///Schema 1.1+. Optional user-facing copy for rendering an end-user-visible notification when the verdict is rendered to the human. Clients render context.headline + context.body + context.evidence directly. 'remediation' is intentionally NOT on the wire (D-16) — it is stored on the platform and accessible via details_url. Older clients (1.0) ignore this field.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub context: ::std::option::Option<VerdictResponseContext>,
///URL to the OpenLatch dashboard with detailed event analysis. Omitted when not available.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub details_url: ::std::option::Option<::std::string::String>,
///Server-assigned or client-generated ID of the event this verdict responds to.
pub event_id: ::std::string::String,
///Total end-to-end processing latency in milliseconds, including cloud round-trip when applicable.
pub latency_ms: f64,
///Schema 1.1+. True when all configured security tools were unreachable. The verdict is fail-open ('allow') and 'context.headline' will read 'Security tools unreachable'. Older clients ignore this field.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub offline: ::std::option::Option<bool>,
///Human-readable explanation for the verdict. Omitted for allow verdicts.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub reason: ::std::option::Option<::std::string::String>,
///Identifier of the detection rule that triggered this verdict. Omitted when no rule matched.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub rule_id: ::std::option::Option<::std::string::String>,
///Schema version for forward compatibility. '1.0' = legacy. '1.1' = adds optional 'context' + 'offline' fields (D-16 of OpenRouter of Security). Older clients ignore unknown fields and remain compatible.
pub schema_version: ::std::string::String,
///Threat severity level (e.g., 'critical', 'high', 'medium', 'low'). Omitted when no threat was detected.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub severity: ::std::option::Option<::std::string::String>,
///Category of detected threat (e.g., 'credential_exfiltration', 'command_injection'). Omitted when no threat detected.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub threat_category: ::std::option::Option<::std::string::String>,
///The verdict: allow = proceed, approve = user-confirmed allow, deny = blocked.
pub verdict: Verdict,
}
impl VerdictResponse {
pub fn builder() -> builder::VerdictResponse {
Default::default()
}
}
///Schema 1.1+. Optional user-facing copy for rendering an end-user-visible notification when the verdict is rendered to the human. Clients render context.headline + context.body + context.evidence directly. 'remediation' is intentionally NOT on the wire (D-16) — it is stored on the platform and accessible via details_url. Older clients (1.0) ignore this field.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Schema 1.1+. Optional user-facing copy for rendering an end-user-visible notification when the verdict is rendered to the human. Clients render context.headline + context.body + context.evidence directly. 'remediation' is intentionally NOT on the wire (D-16) — it is stored on the platform and accessible via details_url. Older clients (1.0) ignore this field.",
/// "type": "object",
/// "required": [
/// "body",
/// "headline"
/// ],
/// "properties": {
/// "body": {
/// "description": "One-paragraph explanation shown below the headline.",
/// "type": "string",
/// "maxLength": 500,
/// "minLength": 1
/// },
/// "evidence": {
/// "type": "array",
/// "items": {
/// "type": "object",
/// "required": [
/// "label"
/// ],
/// "properties": {
/// "label": {
/// "description": "Short tag, e.g. 'credit_card', 'host', 'tool_name'.",
/// "type": "string",
/// "maxLength": 64,
/// "minLength": 1
/// },
/// "value_redacted": {
/// "description": "Redacted display string. Provider redacts before submission; platform re-runs SENSITIVE_FIELD_PATTERNS defensively.",
/// "type": "string",
/// "maxLength": 200
/// }
/// },
/// "additionalProperties": false
/// },
/// "maxItems": 16
/// },
/// "headline": {
/// "description": "One-line summary shown as the toast / notification title.",
/// "type": "string",
/// "maxLength": 120,
/// "minLength": 1
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct VerdictResponseContext {
///One-paragraph explanation shown below the headline.
pub body: VerdictResponseContextBody,
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub evidence: ::std::vec::Vec<VerdictResponseContextEvidenceItem>,
///One-line summary shown as the toast / notification title.
pub headline: VerdictResponseContextHeadline,
}
impl VerdictResponseContext {
pub fn builder() -> builder::VerdictResponseContext {
Default::default()
}
}
///One-paragraph explanation shown below the headline.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "One-paragraph explanation shown below the headline.",
/// "type": "string",
/// "maxLength": 500,
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct VerdictResponseContextBody(::std::string::String);
impl ::std::ops::Deref for VerdictResponseContextBody {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<VerdictResponseContextBody> for ::std::string::String {
fn from(value: VerdictResponseContextBody) -> Self {
value.0
}
}
impl ::std::str::FromStr for VerdictResponseContextBody {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() > 500usize {
return Err("longer than 500 characters".into());
}
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for VerdictResponseContextBody {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for VerdictResponseContextBody {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for VerdictResponseContextBody {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for VerdictResponseContextBody {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///`VerdictResponseContextEvidenceItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "label"
/// ],
/// "properties": {
/// "label": {
/// "description": "Short tag, e.g. 'credit_card', 'host', 'tool_name'.",
/// "type": "string",
/// "maxLength": 64,
/// "minLength": 1
/// },
/// "value_redacted": {
/// "description": "Redacted display string. Provider redacts before submission; platform re-runs SENSITIVE_FIELD_PATTERNS defensively.",
/// "type": "string",
/// "maxLength": 200
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct VerdictResponseContextEvidenceItem {
///Short tag, e.g. 'credit_card', 'host', 'tool_name'.
pub label: VerdictResponseContextEvidenceItemLabel,
///Redacted display string. Provider redacts before submission; platform re-runs SENSITIVE_FIELD_PATTERNS defensively.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub value_redacted: ::std::option::Option<VerdictResponseContextEvidenceItemValueRedacted>,
}
impl VerdictResponseContextEvidenceItem {
pub fn builder() -> builder::VerdictResponseContextEvidenceItem {
Default::default()
}
}
///Short tag, e.g. 'credit_card', 'host', 'tool_name'.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Short tag, e.g. 'credit_card', 'host', 'tool_name'.",
/// "type": "string",
/// "maxLength": 64,
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct VerdictResponseContextEvidenceItemLabel(::std::string::String);
impl ::std::ops::Deref for VerdictResponseContextEvidenceItemLabel {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<VerdictResponseContextEvidenceItemLabel> for ::std::string::String {
fn from(value: VerdictResponseContextEvidenceItemLabel) -> Self {
value.0
}
}
impl ::std::str::FromStr for VerdictResponseContextEvidenceItemLabel {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() > 64usize {
return Err("longer than 64 characters".into());
}
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for VerdictResponseContextEvidenceItemLabel {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for VerdictResponseContextEvidenceItemLabel {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for VerdictResponseContextEvidenceItemLabel {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for VerdictResponseContextEvidenceItemLabel {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///Redacted display string. Provider redacts before submission; platform re-runs SENSITIVE_FIELD_PATTERNS defensively.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Redacted display string. Provider redacts before submission; platform re-runs SENSITIVE_FIELD_PATTERNS defensively.",
/// "type": "string",
/// "maxLength": 200
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct VerdictResponseContextEvidenceItemValueRedacted(::std::string::String);
impl ::std::ops::Deref for VerdictResponseContextEvidenceItemValueRedacted {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<VerdictResponseContextEvidenceItemValueRedacted>
for ::std::string::String
{
fn from(value: VerdictResponseContextEvidenceItemValueRedacted) -> Self {
value.0
}
}
impl ::std::str::FromStr for VerdictResponseContextEvidenceItemValueRedacted {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() > 200usize {
return Err("longer than 200 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for VerdictResponseContextEvidenceItemValueRedacted {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String>
for VerdictResponseContextEvidenceItemValueRedacted
{
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String>
for VerdictResponseContextEvidenceItemValueRedacted
{
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for VerdictResponseContextEvidenceItemValueRedacted {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///One-line summary shown as the toast / notification title.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "One-line summary shown as the toast / notification title.",
/// "type": "string",
/// "maxLength": 120,
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct VerdictResponseContextHeadline(::std::string::String);
impl ::std::ops::Deref for VerdictResponseContextHeadline {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<VerdictResponseContextHeadline> for ::std::string::String {
fn from(value: VerdictResponseContextHeadline) -> Self {
value.0
}
}
impl ::std::str::FromStr for VerdictResponseContextHeadline {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() > 120usize {
return Err("longer than 120 characters".into());
}
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for VerdictResponseContextHeadline {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for VerdictResponseContextHeadline {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for VerdictResponseContextHeadline {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for VerdictResponseContextHeadline {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
/// Types for composing complex structures.
pub mod builder {
#[derive(Clone, Debug)]
pub struct AuthMeResponse {
email: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
organization_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
organization_name: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
user_db_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for AuthMeResponse {
fn default() -> Self {
Self {
email: Ok(Default::default()),
id: Ok(Default::default()),
organization_id: Ok(Default::default()),
organization_name: Ok(Default::default()),
user_db_id: Ok(Default::default()),
}
}
}
impl AuthMeResponse {
pub fn email<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.email = value
.try_into()
.map_err(|e| format!("error converting supplied value for email: {e}"));
self
}
pub fn id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.id = value
.try_into()
.map_err(|e| format!("error converting supplied value for id: {e}"));
self
}
pub fn organization_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.organization_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for organization_id: {e}"));
self
}
pub fn organization_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.organization_name = value
.try_into()
.map_err(|e| format!("error converting supplied value for organization_name: {e}"));
self
}
pub fn user_db_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.user_db_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for user_db_id: {e}"));
self
}
}
impl ::std::convert::TryFrom<AuthMeResponse> for super::AuthMeResponse {
type Error = super::error::ConversionError;
fn try_from(
value: AuthMeResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
email: value.email?,
id: value.id?,
organization_id: value.organization_id?,
organization_name: value.organization_name?,
user_db_id: value.user_db_id?,
})
}
}
impl ::std::convert::From<super::AuthMeResponse> for AuthMeResponse {
fn from(value: super::AuthMeResponse) -> Self {
Self {
email: Ok(value.email),
id: Ok(value.id),
organization_id: Ok(value.organization_id),
organization_name: Ok(value.organization_name),
user_db_id: Ok(value.user_db_id),
}
}
}
#[derive(Clone, Debug)]
pub struct BindingMetricsResponse {
active_penalty: ::std::result::Result<::std::option::Option<f64>, ::std::string::String>,
binding_id: ::std::result::Result<::std::string::String, ::std::string::String>,
latency_ms:
::std::result::Result<super::BindingMetricsResponseLatencyMs, ::std::string::String>,
score: ::std::result::Result<f64, ::std::string::String>,
score_components: ::std::result::Result<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
::std::string::String,
>,
success_rate_24h: ::std::result::Result<f64, ::std::string::String>,
thumbs_down_rate_7d:
::std::result::Result<::std::option::Option<f64>, ::std::string::String>,
}
impl ::std::default::Default for BindingMetricsResponse {
fn default() -> Self {
Self {
active_penalty: Ok(Default::default()),
binding_id: Err("no value supplied for binding_id".to_string()),
latency_ms: Err("no value supplied for latency_ms".to_string()),
score: Err("no value supplied for score".to_string()),
score_components: Ok(Default::default()),
success_rate_24h: Err("no value supplied for success_rate_24h".to_string()),
thumbs_down_rate_7d: Ok(Default::default()),
}
}
}
impl BindingMetricsResponse {
pub fn active_penalty<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<f64>>,
T::Error: ::std::fmt::Display,
{
self.active_penalty = value
.try_into()
.map_err(|e| format!("error converting supplied value for active_penalty: {e}"));
self
}
pub fn binding_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.binding_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for binding_id: {e}"));
self
}
pub fn latency_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::BindingMetricsResponseLatencyMs>,
T::Error: ::std::fmt::Display,
{
self.latency_ms = value
.try_into()
.map_err(|e| format!("error converting supplied value for latency_ms: {e}"));
self
}
pub fn score<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<f64>,
T::Error: ::std::fmt::Display,
{
self.score = value
.try_into()
.map_err(|e| format!("error converting supplied value for score: {e}"));
self
}
pub fn score_components<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
T::Error: ::std::fmt::Display,
{
self.score_components = value
.try_into()
.map_err(|e| format!("error converting supplied value for score_components: {e}"));
self
}
pub fn success_rate_24h<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<f64>,
T::Error: ::std::fmt::Display,
{
self.success_rate_24h = value
.try_into()
.map_err(|e| format!("error converting supplied value for success_rate_24h: {e}"));
self
}
pub fn thumbs_down_rate_7d<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<f64>>,
T::Error: ::std::fmt::Display,
{
self.thumbs_down_rate_7d = value.try_into().map_err(|e| {
format!("error converting supplied value for thumbs_down_rate_7d: {e}")
});
self
}
}
impl ::std::convert::TryFrom<BindingMetricsResponse> for super::BindingMetricsResponse {
type Error = super::error::ConversionError;
fn try_from(
value: BindingMetricsResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
active_penalty: value.active_penalty?,
binding_id: value.binding_id?,
latency_ms: value.latency_ms?,
score: value.score?,
score_components: value.score_components?,
success_rate_24h: value.success_rate_24h?,
thumbs_down_rate_7d: value.thumbs_down_rate_7d?,
})
}
}
impl ::std::convert::From<super::BindingMetricsResponse> for BindingMetricsResponse {
fn from(value: super::BindingMetricsResponse) -> Self {
Self {
active_penalty: Ok(value.active_penalty),
binding_id: Ok(value.binding_id),
latency_ms: Ok(value.latency_ms),
score: Ok(value.score),
score_components: Ok(value.score_components),
success_rate_24h: Ok(value.success_rate_24h),
thumbs_down_rate_7d: Ok(value.thumbs_down_rate_7d),
}
}
}
#[derive(Clone, Debug)]
pub struct BindingMetricsResponseLatencyMs {
p50: ::std::result::Result<u64, ::std::string::String>,
p95: ::std::result::Result<u64, ::std::string::String>,
p99: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for BindingMetricsResponseLatencyMs {
fn default() -> Self {
Self {
p50: Err("no value supplied for p50".to_string()),
p95: Err("no value supplied for p95".to_string()),
p99: Err("no value supplied for p99".to_string()),
}
}
}
impl BindingMetricsResponseLatencyMs {
pub fn p50<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.p50 = value
.try_into()
.map_err(|e| format!("error converting supplied value for p50: {e}"));
self
}
pub fn p95<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.p95 = value
.try_into()
.map_err(|e| format!("error converting supplied value for p95: {e}"));
self
}
pub fn p99<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.p99 = value
.try_into()
.map_err(|e| format!("error converting supplied value for p99: {e}"));
self
}
}
impl ::std::convert::TryFrom<BindingMetricsResponseLatencyMs>
for super::BindingMetricsResponseLatencyMs
{
type Error = super::error::ConversionError;
fn try_from(
value: BindingMetricsResponseLatencyMs,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
p50: value.p50?,
p95: value.p95?,
p99: value.p99?,
})
}
}
impl ::std::convert::From<super::BindingMetricsResponseLatencyMs>
for BindingMetricsResponseLatencyMs
{
fn from(value: super::BindingMetricsResponseLatencyMs) -> Self {
Self {
p50: Ok(value.p50),
p95: Ok(value.p95),
p99: Ok(value.p99),
}
}
}
#[derive(Clone, Debug)]
pub struct BindingV2 {
capacity_qps: ::std::result::Result<::std::num::NonZeroU64, ::std::string::String>,
compliance:
::std::result::Result<::std::vec::Vec<::std::string::String>, ::std::string::String>,
data_handling: ::std::result::Result<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
::std::string::String,
>,
declared_latency_p95_ms:
::std::result::Result<::std::num::NonZeroU64, ::std::string::String>,
local_endpoint: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
pricing: ::std::result::Result<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
::std::string::String,
>,
priority: ::std::result::Result<i64, ::std::string::String>,
process_override: ::std::result::Result<
::std::option::Option<super::ProcessOverrideV2>,
::std::string::String,
>,
provider: ::std::result::Result<::std::string::String, ::std::string::String>,
tool: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for BindingV2 {
fn default() -> Self {
Self {
capacity_qps: Err("no value supplied for capacity_qps".to_string()),
compliance: Ok(Default::default()),
data_handling: Ok(Default::default()),
declared_latency_p95_ms: Err(
"no value supplied for declared_latency_p95_ms".to_string()
),
local_endpoint: Ok(Default::default()),
pricing: Ok(Default::default()),
priority: Err("no value supplied for priority".to_string()),
process_override: Ok(Default::default()),
provider: Err("no value supplied for provider".to_string()),
tool: Err("no value supplied for tool".to_string()),
}
}
}
impl BindingV2 {
pub fn capacity_qps<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::num::NonZeroU64>,
T::Error: ::std::fmt::Display,
{
self.capacity_qps = value
.try_into()
.map_err(|e| format!("error converting supplied value for capacity_qps: {e}"));
self
}
pub fn compliance<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.compliance = value
.try_into()
.map_err(|e| format!("error converting supplied value for compliance: {e}"));
self
}
pub fn data_handling<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
T::Error: ::std::fmt::Display,
{
self.data_handling = value
.try_into()
.map_err(|e| format!("error converting supplied value for data_handling: {e}"));
self
}
pub fn declared_latency_p95_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::num::NonZeroU64>,
T::Error: ::std::fmt::Display,
{
self.declared_latency_p95_ms = value.try_into().map_err(|e| {
format!("error converting supplied value for declared_latency_p95_ms: {e}")
});
self
}
pub fn local_endpoint<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.local_endpoint = value
.try_into()
.map_err(|e| format!("error converting supplied value for local_endpoint: {e}"));
self
}
pub fn pricing<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
T::Error: ::std::fmt::Display,
{
self.pricing = value
.try_into()
.map_err(|e| format!("error converting supplied value for pricing: {e}"));
self
}
pub fn priority<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.priority = value
.try_into()
.map_err(|e| format!("error converting supplied value for priority: {e}"));
self
}
pub fn process_override<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ProcessOverrideV2>>,
T::Error: ::std::fmt::Display,
{
self.process_override = value
.try_into()
.map_err(|e| format!("error converting supplied value for process_override: {e}"));
self
}
pub fn provider<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.provider = value
.try_into()
.map_err(|e| format!("error converting supplied value for provider: {e}"));
self
}
pub fn tool<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.tool = value
.try_into()
.map_err(|e| format!("error converting supplied value for tool: {e}"));
self
}
}
impl ::std::convert::TryFrom<BindingV2> for super::BindingV2 {
type Error = super::error::ConversionError;
fn try_from(
value: BindingV2,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
capacity_qps: value.capacity_qps?,
compliance: value.compliance?,
data_handling: value.data_handling?,
declared_latency_p95_ms: value.declared_latency_p95_ms?,
local_endpoint: value.local_endpoint?,
pricing: value.pricing?,
priority: value.priority?,
process_override: value.process_override?,
provider: value.provider?,
tool: value.tool?,
})
}
}
impl ::std::convert::From<super::BindingV2> for BindingV2 {
fn from(value: super::BindingV2) -> Self {
Self {
capacity_qps: Ok(value.capacity_qps),
compliance: Ok(value.compliance),
data_handling: Ok(value.data_handling),
declared_latency_p95_ms: Ok(value.declared_latency_p95_ms),
local_endpoint: Ok(value.local_endpoint),
pricing: Ok(value.pricing),
priority: Ok(value.priority),
process_override: Ok(value.process_override),
provider: Ok(value.provider),
tool: Ok(value.tool),
}
}
}
#[derive(Clone, Debug)]
pub struct CatalogAgentsResponse {
agents: ::std::result::Result<
::std::vec::Vec<super::CatalogAgentsResponseAgentsItem>,
::std::string::String,
>,
}
impl ::std::default::Default for CatalogAgentsResponse {
fn default() -> Self {
Self {
agents: Err("no value supplied for agents".to_string()),
}
}
}
impl CatalogAgentsResponse {
pub fn agents<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::CatalogAgentsResponseAgentsItem>>,
T::Error: ::std::fmt::Display,
{
self.agents = value
.try_into()
.map_err(|e| format!("error converting supplied value for agents: {e}"));
self
}
}
impl ::std::convert::TryFrom<CatalogAgentsResponse> for super::CatalogAgentsResponse {
type Error = super::error::ConversionError;
fn try_from(
value: CatalogAgentsResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
agents: value.agents?,
})
}
}
impl ::std::convert::From<super::CatalogAgentsResponse> for CatalogAgentsResponse {
fn from(value: super::CatalogAgentsResponse) -> Self {
Self {
agents: Ok(value.agents),
}
}
}
#[derive(Clone, Debug)]
pub struct CatalogAgentsResponseAgentsItem {
display_name: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
platform: ::std::result::Result<::std::string::String, ::std::string::String>,
supported_hook_events:
::std::result::Result<::std::vec::Vec<::std::string::String>, ::std::string::String>,
}
impl ::std::default::Default for CatalogAgentsResponseAgentsItem {
fn default() -> Self {
Self {
display_name: Ok(Default::default()),
platform: Err("no value supplied for platform".to_string()),
supported_hook_events: Ok(Default::default()),
}
}
}
impl CatalogAgentsResponseAgentsItem {
pub fn display_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.display_name = value
.try_into()
.map_err(|e| format!("error converting supplied value for display_name: {e}"));
self
}
pub fn platform<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.platform = value
.try_into()
.map_err(|e| format!("error converting supplied value for platform: {e}"));
self
}
pub fn supported_hook_events<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.supported_hook_events = value.try_into().map_err(|e| {
format!("error converting supplied value for supported_hook_events: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CatalogAgentsResponseAgentsItem>
for super::CatalogAgentsResponseAgentsItem
{
type Error = super::error::ConversionError;
fn try_from(
value: CatalogAgentsResponseAgentsItem,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
display_name: value.display_name?,
platform: value.platform?,
supported_hook_events: value.supported_hook_events?,
})
}
}
impl ::std::convert::From<super::CatalogAgentsResponseAgentsItem>
for CatalogAgentsResponseAgentsItem
{
fn from(value: super::CatalogAgentsResponseAgentsItem) -> Self {
Self {
display_name: Ok(value.display_name),
platform: Ok(value.platform),
supported_hook_events: Ok(value.supported_hook_events),
}
}
}
#[derive(Clone, Debug)]
pub struct CatalogErrorCodesResponse {
error_codes: ::std::result::Result<
::std::vec::Vec<super::CatalogErrorCodesResponseErrorCodesItem>,
::std::string::String,
>,
}
impl ::std::default::Default for CatalogErrorCodesResponse {
fn default() -> Self {
Self {
error_codes: Err("no value supplied for error_codes".to_string()),
}
}
}
impl CatalogErrorCodesResponse {
pub fn error_codes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::vec::Vec<super::CatalogErrorCodesResponseErrorCodesItem>,
>,
T::Error: ::std::fmt::Display,
{
self.error_codes = value
.try_into()
.map_err(|e| format!("error converting supplied value for error_codes: {e}"));
self
}
}
impl ::std::convert::TryFrom<CatalogErrorCodesResponse> for super::CatalogErrorCodesResponse {
type Error = super::error::ConversionError;
fn try_from(
value: CatalogErrorCodesResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
error_codes: value.error_codes?,
})
}
}
impl ::std::convert::From<super::CatalogErrorCodesResponse> for CatalogErrorCodesResponse {
fn from(value: super::CatalogErrorCodesResponse) -> Self {
Self {
error_codes: Ok(value.error_codes),
}
}
}
#[derive(Clone, Debug)]
pub struct CatalogErrorCodesResponseErrorCodesItem {
code: ::std::result::Result<
super::CatalogErrorCodesResponseErrorCodesItemCode,
::std::string::String,
>,
docs_url: ::std::result::Result<::std::string::String, ::std::string::String>,
remediation: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
title: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for CatalogErrorCodesResponseErrorCodesItem {
fn default() -> Self {
Self {
code: Err("no value supplied for code".to_string()),
docs_url: Err("no value supplied for docs_url".to_string()),
remediation: Ok(Default::default()),
title: Err("no value supplied for title".to_string()),
}
}
}
impl CatalogErrorCodesResponseErrorCodesItem {
pub fn code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::CatalogErrorCodesResponseErrorCodesItemCode>,
T::Error: ::std::fmt::Display,
{
self.code = value
.try_into()
.map_err(|e| format!("error converting supplied value for code: {e}"));
self
}
pub fn docs_url<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.docs_url = value
.try_into()
.map_err(|e| format!("error converting supplied value for docs_url: {e}"));
self
}
pub fn remediation<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.remediation = value
.try_into()
.map_err(|e| format!("error converting supplied value for remediation: {e}"));
self
}
pub fn title<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.title = value
.try_into()
.map_err(|e| format!("error converting supplied value for title: {e}"));
self
}
}
impl ::std::convert::TryFrom<CatalogErrorCodesResponseErrorCodesItem>
for super::CatalogErrorCodesResponseErrorCodesItem
{
type Error = super::error::ConversionError;
fn try_from(
value: CatalogErrorCodesResponseErrorCodesItem,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
code: value.code?,
docs_url: value.docs_url?,
remediation: value.remediation?,
title: value.title?,
})
}
}
impl ::std::convert::From<super::CatalogErrorCodesResponseErrorCodesItem>
for CatalogErrorCodesResponseErrorCodesItem
{
fn from(value: super::CatalogErrorCodesResponseErrorCodesItem) -> Self {
Self {
code: Ok(value.code),
docs_url: Ok(value.docs_url),
remediation: Ok(value.remediation),
title: Ok(value.title),
}
}
}
#[derive(Clone, Debug)]
pub struct CatalogHooksResponse {
hooks: ::std::result::Result<
::std::vec::Vec<super::CatalogHooksResponseHooksItem>,
::std::string::String,
>,
}
impl ::std::default::Default for CatalogHooksResponse {
fn default() -> Self {
Self {
hooks: Err("no value supplied for hooks".to_string()),
}
}
}
impl CatalogHooksResponse {
pub fn hooks<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::CatalogHooksResponseHooksItem>>,
T::Error: ::std::fmt::Display,
{
self.hooks = value
.try_into()
.map_err(|e| format!("error converting supplied value for hooks: {e}"));
self
}
}
impl ::std::convert::TryFrom<CatalogHooksResponse> for super::CatalogHooksResponse {
type Error = super::error::ConversionError;
fn try_from(
value: CatalogHooksResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
hooks: value.hooks?,
})
}
}
impl ::std::convert::From<super::CatalogHooksResponse> for CatalogHooksResponse {
fn from(value: super::CatalogHooksResponse) -> Self {
Self {
hooks: Ok(value.hooks),
}
}
}
#[derive(Clone, Debug)]
pub struct CatalogHooksResponseHooksItem {
agent_platforms:
::std::result::Result<::std::vec::Vec<::std::string::String>, ::std::string::String>,
description: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
event_type: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for CatalogHooksResponseHooksItem {
fn default() -> Self {
Self {
agent_platforms: Ok(Default::default()),
description: Ok(Default::default()),
event_type: Err("no value supplied for event_type".to_string()),
}
}
}
impl CatalogHooksResponseHooksItem {
pub fn agent_platforms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.agent_platforms = value
.try_into()
.map_err(|e| format!("error converting supplied value for agent_platforms: {e}"));
self
}
pub fn description<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.description = value
.try_into()
.map_err(|e| format!("error converting supplied value for description: {e}"));
self
}
pub fn event_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.event_type = value
.try_into()
.map_err(|e| format!("error converting supplied value for event_type: {e}"));
self
}
}
impl ::std::convert::TryFrom<CatalogHooksResponseHooksItem>
for super::CatalogHooksResponseHooksItem
{
type Error = super::error::ConversionError;
fn try_from(
value: CatalogHooksResponseHooksItem,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
agent_platforms: value.agent_platforms?,
description: value.description?,
event_type: value.event_type?,
})
}
}
impl ::std::convert::From<super::CatalogHooksResponseHooksItem> for CatalogHooksResponseHooksItem {
fn from(value: super::CatalogHooksResponseHooksItem) -> Self {
Self {
agent_platforms: Ok(value.agent_platforms),
description: Ok(value.description),
event_type: Ok(value.event_type),
}
}
}
#[derive(Clone, Debug)]
pub struct CloudIngestionResponse {
error: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
event_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
status: ::std::result::Result<super::CloudIngestionResponseStatus, ::std::string::String>,
}
impl ::std::default::Default for CloudIngestionResponse {
fn default() -> Self {
Self {
error: Ok(Default::default()),
event_id: Ok(Default::default()),
status: Err("no value supplied for status".to_string()),
}
}
}
impl CloudIngestionResponse {
pub fn error<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.error = value
.try_into()
.map_err(|e| format!("error converting supplied value for error: {e}"));
self
}
pub fn event_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.event_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for event_id: {e}"));
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::CloudIngestionResponseStatus>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| format!("error converting supplied value for status: {e}"));
self
}
}
impl ::std::convert::TryFrom<CloudIngestionResponse> for super::CloudIngestionResponse {
type Error = super::error::ConversionError;
fn try_from(
value: CloudIngestionResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
error: value.error?,
event_id: value.event_id?,
status: value.status?,
})
}
}
impl ::std::convert::From<super::CloudIngestionResponse> for CloudIngestionResponse {
fn from(value: super::CloudIngestionResponse) -> Self {
Self {
error: Ok(value.error),
event_id: Ok(value.event_id),
status: Ok(value.status),
}
}
}
#[derive(Clone, Debug)]
pub struct EditorProfile {
description: ::std::result::Result<
::std::option::Option<super::EditorProfileDescription>,
::std::string::String,
>,
display_name: ::std::result::Result<
::std::option::Option<super::EditorProfileDisplayName>,
::std::string::String,
>,
docs_url: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
homepage_url: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for EditorProfile {
fn default() -> Self {
Self {
description: Ok(Default::default()),
display_name: Ok(Default::default()),
docs_url: Ok(Default::default()),
homepage_url: Ok(Default::default()),
}
}
}
impl EditorProfile {
pub fn description<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::EditorProfileDescription>>,
T::Error: ::std::fmt::Display,
{
self.description = value
.try_into()
.map_err(|e| format!("error converting supplied value for description: {e}"));
self
}
pub fn display_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::EditorProfileDisplayName>>,
T::Error: ::std::fmt::Display,
{
self.display_name = value
.try_into()
.map_err(|e| format!("error converting supplied value for display_name: {e}"));
self
}
pub fn docs_url<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.docs_url = value
.try_into()
.map_err(|e| format!("error converting supplied value for docs_url: {e}"));
self
}
pub fn homepage_url<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.homepage_url = value
.try_into()
.map_err(|e| format!("error converting supplied value for homepage_url: {e}"));
self
}
}
impl ::std::convert::TryFrom<EditorProfile> for super::EditorProfile {
type Error = super::error::ConversionError;
fn try_from(
value: EditorProfile,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
description: value.description?,
display_name: value.display_name?,
docs_url: value.docs_url?,
homepage_url: value.homepage_url?,
})
}
}
impl ::std::convert::From<super::EditorProfile> for EditorProfile {
fn from(value: super::EditorProfile) -> Self {
Self {
description: Ok(value.description),
display_name: Ok(value.display_name),
docs_url: Ok(value.docs_url),
homepage_url: Ok(value.homepage_url),
}
}
}
#[derive(Clone, Debug)]
pub struct Enums {}
impl ::std::default::Default for Enums {
fn default() -> Self {
Self {}
}
}
impl Enums {}
impl ::std::convert::TryFrom<Enums> for super::Enums {
type Error = super::error::ConversionError;
fn try_from(_value: Enums) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {})
}
}
impl ::std::convert::From<super::Enums> for Enums {
fn from(_value: super::Enums) -> Self {
Self {}
}
}
#[derive(Clone, Debug)]
pub struct EventEnvelope {
agentid: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
agentversion: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
arch: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
clientversion: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
data: ::std::result::Result<
::std::option::Option<::serde_json::Value>,
::std::string::String,
>,
datacontenttype: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
id: ::std::result::Result<::std::string::String, ::std::string::String>,
localipv4: ::std::result::Result<
::std::option::Option<::std::net::Ipv4Addr>,
::std::string::String,
>,
localipv6: ::std::result::Result<
::std::option::Option<::std::net::Ipv6Addr>,
::std::string::String,
>,
os: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
publicipv4: ::std::result::Result<
::std::option::Option<::std::net::Ipv4Addr>,
::std::string::String,
>,
publicipv6: ::std::result::Result<
::std::option::Option<::std::net::Ipv6Addr>,
::std::string::String,
>,
source: ::std::result::Result<super::AgentType, ::std::string::String>,
specversion: ::std::result::Result<::std::string::String, ::std::string::String>,
subject: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
time:
::std::result::Result<::chrono::DateTime<::chrono::offset::Utc>, ::std::string::String>,
type_: ::std::result::Result<super::HookEventType, ::std::string::String>,
}
impl ::std::default::Default for EventEnvelope {
fn default() -> Self {
Self {
agentid: Ok(Default::default()),
agentversion: Ok(Default::default()),
arch: Ok(Default::default()),
clientversion: Ok(Default::default()),
data: Ok(Default::default()),
datacontenttype: Ok(Default::default()),
id: Err("no value supplied for id".to_string()),
localipv4: Ok(Default::default()),
localipv6: Ok(Default::default()),
os: Ok(Default::default()),
publicipv4: Ok(Default::default()),
publicipv6: Ok(Default::default()),
source: Err("no value supplied for source".to_string()),
specversion: Err("no value supplied for specversion".to_string()),
subject: Ok(Default::default()),
time: Err("no value supplied for time".to_string()),
type_: Err("no value supplied for type_".to_string()),
}
}
}
impl EventEnvelope {
pub fn agentid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.agentid = value
.try_into()
.map_err(|e| format!("error converting supplied value for agentid: {e}"));
self
}
pub fn agentversion<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.agentversion = value
.try_into()
.map_err(|e| format!("error converting supplied value for agentversion: {e}"));
self
}
pub fn arch<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.arch = value
.try_into()
.map_err(|e| format!("error converting supplied value for arch: {e}"));
self
}
pub fn clientversion<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.clientversion = value
.try_into()
.map_err(|e| format!("error converting supplied value for clientversion: {e}"));
self
}
pub fn data<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::serde_json::Value>>,
T::Error: ::std::fmt::Display,
{
self.data = value
.try_into()
.map_err(|e| format!("error converting supplied value for data: {e}"));
self
}
pub fn datacontenttype<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.datacontenttype = value
.try_into()
.map_err(|e| format!("error converting supplied value for datacontenttype: {e}"));
self
}
pub fn id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.id = value
.try_into()
.map_err(|e| format!("error converting supplied value for id: {e}"));
self
}
pub fn localipv4<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::net::Ipv4Addr>>,
T::Error: ::std::fmt::Display,
{
self.localipv4 = value
.try_into()
.map_err(|e| format!("error converting supplied value for localipv4: {e}"));
self
}
pub fn localipv6<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::net::Ipv6Addr>>,
T::Error: ::std::fmt::Display,
{
self.localipv6 = value
.try_into()
.map_err(|e| format!("error converting supplied value for localipv6: {e}"));
self
}
pub fn os<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.os = value
.try_into()
.map_err(|e| format!("error converting supplied value for os: {e}"));
self
}
pub fn publicipv4<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::net::Ipv4Addr>>,
T::Error: ::std::fmt::Display,
{
self.publicipv4 = value
.try_into()
.map_err(|e| format!("error converting supplied value for publicipv4: {e}"));
self
}
pub fn publicipv6<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::net::Ipv6Addr>>,
T::Error: ::std::fmt::Display,
{
self.publicipv6 = value
.try_into()
.map_err(|e| format!("error converting supplied value for publicipv6: {e}"));
self
}
pub fn source<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::AgentType>,
T::Error: ::std::fmt::Display,
{
self.source = value
.try_into()
.map_err(|e| format!("error converting supplied value for source: {e}"));
self
}
pub fn specversion<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.specversion = value
.try_into()
.map_err(|e| format!("error converting supplied value for specversion: {e}"));
self
}
pub fn subject<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.subject = value
.try_into()
.map_err(|e| format!("error converting supplied value for subject: {e}"));
self
}
pub fn time<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::chrono::DateTime<::chrono::offset::Utc>>,
T::Error: ::std::fmt::Display,
{
self.time = value
.try_into()
.map_err(|e| format!("error converting supplied value for time: {e}"));
self
}
pub fn type_<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::HookEventType>,
T::Error: ::std::fmt::Display,
{
self.type_ = value
.try_into()
.map_err(|e| format!("error converting supplied value for type_: {e}"));
self
}
}
impl ::std::convert::TryFrom<EventEnvelope> for super::EventEnvelope {
type Error = super::error::ConversionError;
fn try_from(
value: EventEnvelope,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
agentid: value.agentid?,
agentversion: value.agentversion?,
arch: value.arch?,
clientversion: value.clientversion?,
data: value.data?,
datacontenttype: value.datacontenttype?,
id: value.id?,
localipv4: value.localipv4?,
localipv6: value.localipv6?,
os: value.os?,
publicipv4: value.publicipv4?,
publicipv6: value.publicipv6?,
source: value.source?,
specversion: value.specversion?,
subject: value.subject?,
time: value.time?,
type_: value.type_?,
})
}
}
impl ::std::convert::From<super::EventEnvelope> for EventEnvelope {
fn from(value: super::EventEnvelope) -> Self {
Self {
agentid: Ok(value.agentid),
agentversion: Ok(value.agentversion),
arch: Ok(value.arch),
clientversion: Ok(value.clientversion),
data: Ok(value.data),
datacontenttype: Ok(value.datacontenttype),
id: Ok(value.id),
localipv4: Ok(value.localipv4),
localipv6: Ok(value.localipv6),
os: Ok(value.os),
publicipv4: Ok(value.publicipv4),
publicipv6: Ok(value.publicipv6),
source: Ok(value.source),
specversion: Ok(value.specversion),
subject: Ok(value.subject),
time: Ok(value.time),
type_: Ok(value.type_),
}
}
}
#[derive(Clone, Debug)]
pub struct HealthCheckV2 {
http: ::std::result::Result<super::HealthCheckV2Http, ::std::string::String>,
}
impl ::std::default::Default for HealthCheckV2 {
fn default() -> Self {
Self {
http: Err("no value supplied for http".to_string()),
}
}
}
impl HealthCheckV2 {
pub fn http<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::HealthCheckV2Http>,
T::Error: ::std::fmt::Display,
{
self.http = value
.try_into()
.map_err(|e| format!("error converting supplied value for http: {e}"));
self
}
}
impl ::std::convert::TryFrom<HealthCheckV2> for super::HealthCheckV2 {
type Error = super::error::ConversionError;
fn try_from(
value: HealthCheckV2,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { http: value.http? })
}
}
impl ::std::convert::From<super::HealthCheckV2> for HealthCheckV2 {
fn from(value: super::HealthCheckV2) -> Self {
Self {
http: Ok(value.http),
}
}
}
#[derive(Clone, Debug)]
pub struct HealthCheckV2Http {
liveness_failure_threshold: ::std::result::Result<
::std::option::Option<::std::num::NonZeroU64>,
::std::string::String,
>,
liveness_period_ms:
::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
liveness_timeout_ms:
::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
path: ::std::result::Result<
::std::option::Option<super::HealthCheckV2HttpPath>,
::std::string::String,
>,
port: ::std::result::Result<::std::num::NonZeroU64, ::std::string::String>,
startup_period_ms: ::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
startup_timeout_ms:
::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
}
impl ::std::default::Default for HealthCheckV2Http {
fn default() -> Self {
Self {
liveness_failure_threshold: Ok(Default::default()),
liveness_period_ms: Ok(Default::default()),
liveness_timeout_ms: Ok(Default::default()),
path: Ok(Default::default()),
port: Err("no value supplied for port".to_string()),
startup_period_ms: Ok(Default::default()),
startup_timeout_ms: Ok(Default::default()),
}
}
}
impl HealthCheckV2Http {
pub fn liveness_failure_threshold<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::num::NonZeroU64>>,
T::Error: ::std::fmt::Display,
{
self.liveness_failure_threshold = value.try_into().map_err(|e| {
format!("error converting supplied value for liveness_failure_threshold: {e}")
});
self
}
pub fn liveness_period_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.liveness_period_ms = value.try_into().map_err(|e| {
format!("error converting supplied value for liveness_period_ms: {e}")
});
self
}
pub fn liveness_timeout_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.liveness_timeout_ms = value.try_into().map_err(|e| {
format!("error converting supplied value for liveness_timeout_ms: {e}")
});
self
}
pub fn path<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::HealthCheckV2HttpPath>>,
T::Error: ::std::fmt::Display,
{
self.path = value
.try_into()
.map_err(|e| format!("error converting supplied value for path: {e}"));
self
}
pub fn port<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::num::NonZeroU64>,
T::Error: ::std::fmt::Display,
{
self.port = value
.try_into()
.map_err(|e| format!("error converting supplied value for port: {e}"));
self
}
pub fn startup_period_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.startup_period_ms = value
.try_into()
.map_err(|e| format!("error converting supplied value for startup_period_ms: {e}"));
self
}
pub fn startup_timeout_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.startup_timeout_ms = value.try_into().map_err(|e| {
format!("error converting supplied value for startup_timeout_ms: {e}")
});
self
}
}
impl ::std::convert::TryFrom<HealthCheckV2Http> for super::HealthCheckV2Http {
type Error = super::error::ConversionError;
fn try_from(
value: HealthCheckV2Http,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
liveness_failure_threshold: value.liveness_failure_threshold?,
liveness_period_ms: value.liveness_period_ms?,
liveness_timeout_ms: value.liveness_timeout_ms?,
path: value.path?,
port: value.port?,
startup_period_ms: value.startup_period_ms?,
startup_timeout_ms: value.startup_timeout_ms?,
})
}
}
impl ::std::convert::From<super::HealthCheckV2Http> for HealthCheckV2Http {
fn from(value: super::HealthCheckV2Http) -> Self {
Self {
liveness_failure_threshold: Ok(value.liveness_failure_threshold),
liveness_period_ms: Ok(value.liveness_period_ms),
liveness_timeout_ms: Ok(value.liveness_timeout_ms),
path: Ok(value.path),
port: Ok(value.port),
startup_period_ms: Ok(value.startup_period_ms),
startup_timeout_ms: Ok(value.startup_timeout_ms),
}
}
}
#[derive(Clone, Debug)]
pub struct Manifest {
bindings:
::std::result::Result<::std::vec::Vec<super::ManifestBinding>, ::std::string::String>,
editor: ::std::result::Result<super::ManifestEditor, ::std::string::String>,
providers:
::std::result::Result<::std::vec::Vec<super::ManifestProvider>, ::std::string::String>,
schema_version: ::std::result::Result<i64, ::std::string::String>,
tools: ::std::result::Result<::std::vec::Vec<super::ManifestTool>, ::std::string::String>,
}
impl ::std::default::Default for Manifest {
fn default() -> Self {
Self {
bindings: Ok(Default::default()),
editor: Err("no value supplied for editor".to_string()),
providers: Ok(Default::default()),
schema_version: Err("no value supplied for schema_version".to_string()),
tools: Ok(Default::default()),
}
}
}
impl Manifest {
pub fn bindings<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::ManifestBinding>>,
T::Error: ::std::fmt::Display,
{
self.bindings = value
.try_into()
.map_err(|e| format!("error converting supplied value for bindings: {e}"));
self
}
pub fn editor<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ManifestEditor>,
T::Error: ::std::fmt::Display,
{
self.editor = value
.try_into()
.map_err(|e| format!("error converting supplied value for editor: {e}"));
self
}
pub fn providers<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::ManifestProvider>>,
T::Error: ::std::fmt::Display,
{
self.providers = value
.try_into()
.map_err(|e| format!("error converting supplied value for providers: {e}"));
self
}
pub fn schema_version<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.schema_version = value
.try_into()
.map_err(|e| format!("error converting supplied value for schema_version: {e}"));
self
}
pub fn tools<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::ManifestTool>>,
T::Error: ::std::fmt::Display,
{
self.tools = value
.try_into()
.map_err(|e| format!("error converting supplied value for tools: {e}"));
self
}
}
impl ::std::convert::TryFrom<Manifest> for super::Manifest {
type Error = super::error::ConversionError;
fn try_from(value: Manifest) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
bindings: value.bindings?,
editor: value.editor?,
providers: value.providers?,
schema_version: value.schema_version?,
tools: value.tools?,
})
}
}
impl ::std::convert::From<super::Manifest> for Manifest {
fn from(value: super::Manifest) -> Self {
Self {
bindings: Ok(value.bindings),
editor: Ok(value.editor),
providers: Ok(value.providers),
schema_version: Ok(value.schema_version),
tools: Ok(value.tools),
}
}
}
#[derive(Clone, Debug)]
pub struct ManifestBinding {
capacity_qps: ::std::result::Result<::std::num::NonZeroU64, ::std::string::String>,
compliance:
::std::result::Result<::std::vec::Vec<::std::string::String>, ::std::string::String>,
data_handling: ::std::result::Result<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
::std::string::String,
>,
declared_latency_p95_ms:
::std::result::Result<::std::num::NonZeroU64, ::std::string::String>,
local_endpoint: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
pricing: ::std::result::Result<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
::std::string::String,
>,
priority: ::std::result::Result<i64, ::std::string::String>,
process: ::std::result::Result<super::ManifestProcess, ::std::string::String>,
provider: ::std::result::Result<::std::string::String, ::std::string::String>,
tool: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for ManifestBinding {
fn default() -> Self {
Self {
capacity_qps: Err("no value supplied for capacity_qps".to_string()),
compliance: Ok(Default::default()),
data_handling: Ok(Default::default()),
declared_latency_p95_ms: Err(
"no value supplied for declared_latency_p95_ms".to_string()
),
local_endpoint: Ok(Default::default()),
pricing: Ok(Default::default()),
priority: Err("no value supplied for priority".to_string()),
process: Err("no value supplied for process".to_string()),
provider: Err("no value supplied for provider".to_string()),
tool: Err("no value supplied for tool".to_string()),
}
}
}
impl ManifestBinding {
pub fn capacity_qps<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::num::NonZeroU64>,
T::Error: ::std::fmt::Display,
{
self.capacity_qps = value
.try_into()
.map_err(|e| format!("error converting supplied value for capacity_qps: {e}"));
self
}
pub fn compliance<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.compliance = value
.try_into()
.map_err(|e| format!("error converting supplied value for compliance: {e}"));
self
}
pub fn data_handling<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
T::Error: ::std::fmt::Display,
{
self.data_handling = value
.try_into()
.map_err(|e| format!("error converting supplied value for data_handling: {e}"));
self
}
pub fn declared_latency_p95_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::num::NonZeroU64>,
T::Error: ::std::fmt::Display,
{
self.declared_latency_p95_ms = value.try_into().map_err(|e| {
format!("error converting supplied value for declared_latency_p95_ms: {e}")
});
self
}
pub fn local_endpoint<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.local_endpoint = value
.try_into()
.map_err(|e| format!("error converting supplied value for local_endpoint: {e}"));
self
}
pub fn pricing<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
T::Error: ::std::fmt::Display,
{
self.pricing = value
.try_into()
.map_err(|e| format!("error converting supplied value for pricing: {e}"));
self
}
pub fn priority<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.priority = value
.try_into()
.map_err(|e| format!("error converting supplied value for priority: {e}"));
self
}
pub fn process<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ManifestProcess>,
T::Error: ::std::fmt::Display,
{
self.process = value
.try_into()
.map_err(|e| format!("error converting supplied value for process: {e}"));
self
}
pub fn provider<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.provider = value
.try_into()
.map_err(|e| format!("error converting supplied value for provider: {e}"));
self
}
pub fn tool<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.tool = value
.try_into()
.map_err(|e| format!("error converting supplied value for tool: {e}"));
self
}
}
impl ::std::convert::TryFrom<ManifestBinding> for super::ManifestBinding {
type Error = super::error::ConversionError;
fn try_from(
value: ManifestBinding,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
capacity_qps: value.capacity_qps?,
compliance: value.compliance?,
data_handling: value.data_handling?,
declared_latency_p95_ms: value.declared_latency_p95_ms?,
local_endpoint: value.local_endpoint?,
pricing: value.pricing?,
priority: value.priority?,
process: value.process?,
provider: value.provider?,
tool: value.tool?,
})
}
}
impl ::std::convert::From<super::ManifestBinding> for ManifestBinding {
fn from(value: super::ManifestBinding) -> Self {
Self {
capacity_qps: Ok(value.capacity_qps),
compliance: Ok(value.compliance),
data_handling: Ok(value.data_handling),
declared_latency_p95_ms: Ok(value.declared_latency_p95_ms),
local_endpoint: Ok(value.local_endpoint),
pricing: Ok(value.pricing),
priority: Ok(value.priority),
process: Ok(value.process),
provider: Ok(value.provider),
tool: Ok(value.tool),
}
}
}
#[derive(Clone, Debug)]
pub struct ManifestCapability {
declared_latency_p95_ms:
::std::result::Result<::std::num::NonZeroU64, ::std::string::String>,
execution_mode:
::std::result::Result<super::ManifestCapabilityExecutionMode, ::std::string::String>,
needs_prior_config_state:
::std::result::Result<::std::option::Option<bool>, ::std::string::String>,
needs_raw_payload: ::std::result::Result<bool, ::std::string::String>,
threat_category:
::std::result::Result<super::ManifestCapabilityThreatCategory, ::std::string::String>,
}
impl ::std::default::Default for ManifestCapability {
fn default() -> Self {
Self {
declared_latency_p95_ms: Err(
"no value supplied for declared_latency_p95_ms".to_string()
),
execution_mode: Err("no value supplied for execution_mode".to_string()),
needs_prior_config_state: Ok(Default::default()),
needs_raw_payload: Err("no value supplied for needs_raw_payload".to_string()),
threat_category: Err("no value supplied for threat_category".to_string()),
}
}
}
impl ManifestCapability {
pub fn declared_latency_p95_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::num::NonZeroU64>,
T::Error: ::std::fmt::Display,
{
self.declared_latency_p95_ms = value.try_into().map_err(|e| {
format!("error converting supplied value for declared_latency_p95_ms: {e}")
});
self
}
pub fn execution_mode<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ManifestCapabilityExecutionMode>,
T::Error: ::std::fmt::Display,
{
self.execution_mode = value
.try_into()
.map_err(|e| format!("error converting supplied value for execution_mode: {e}"));
self
}
pub fn needs_prior_config_state<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.needs_prior_config_state = value.try_into().map_err(|e| {
format!("error converting supplied value for needs_prior_config_state: {e}")
});
self
}
pub fn needs_raw_payload<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.needs_raw_payload = value
.try_into()
.map_err(|e| format!("error converting supplied value for needs_raw_payload: {e}"));
self
}
pub fn threat_category<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ManifestCapabilityThreatCategory>,
T::Error: ::std::fmt::Display,
{
self.threat_category = value
.try_into()
.map_err(|e| format!("error converting supplied value for threat_category: {e}"));
self
}
}
impl ::std::convert::TryFrom<ManifestCapability> for super::ManifestCapability {
type Error = super::error::ConversionError;
fn try_from(
value: ManifestCapability,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
declared_latency_p95_ms: value.declared_latency_p95_ms?,
execution_mode: value.execution_mode?,
needs_prior_config_state: value.needs_prior_config_state?,
needs_raw_payload: value.needs_raw_payload?,
threat_category: value.threat_category?,
})
}
}
impl ::std::convert::From<super::ManifestCapability> for ManifestCapability {
fn from(value: super::ManifestCapability) -> Self {
Self {
declared_latency_p95_ms: Ok(value.declared_latency_p95_ms),
execution_mode: Ok(value.execution_mode),
needs_prior_config_state: Ok(value.needs_prior_config_state),
needs_raw_payload: Ok(value.needs_raw_payload),
threat_category: Ok(value.threat_category),
}
}
}
#[derive(Clone, Debug)]
pub struct ManifestEditor {
description: ::std::result::Result<
::std::option::Option<super::ManifestEditorDescription>,
::std::string::String,
>,
display_name:
::std::result::Result<super::ManifestEditorDisplayName, ::std::string::String>,
docs_url: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
homepage_url: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
slug: ::std::result::Result<super::ManifestEditorSlug, ::std::string::String>,
}
impl ::std::default::Default for ManifestEditor {
fn default() -> Self {
Self {
description: Ok(Default::default()),
display_name: Err("no value supplied for display_name".to_string()),
docs_url: Ok(Default::default()),
homepage_url: Ok(Default::default()),
slug: Err("no value supplied for slug".to_string()),
}
}
}
impl ManifestEditor {
pub fn description<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ManifestEditorDescription>>,
T::Error: ::std::fmt::Display,
{
self.description = value
.try_into()
.map_err(|e| format!("error converting supplied value for description: {e}"));
self
}
pub fn display_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ManifestEditorDisplayName>,
T::Error: ::std::fmt::Display,
{
self.display_name = value
.try_into()
.map_err(|e| format!("error converting supplied value for display_name: {e}"));
self
}
pub fn docs_url<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.docs_url = value
.try_into()
.map_err(|e| format!("error converting supplied value for docs_url: {e}"));
self
}
pub fn homepage_url<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.homepage_url = value
.try_into()
.map_err(|e| format!("error converting supplied value for homepage_url: {e}"));
self
}
pub fn slug<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ManifestEditorSlug>,
T::Error: ::std::fmt::Display,
{
self.slug = value
.try_into()
.map_err(|e| format!("error converting supplied value for slug: {e}"));
self
}
}
impl ::std::convert::TryFrom<ManifestEditor> for super::ManifestEditor {
type Error = super::error::ConversionError;
fn try_from(
value: ManifestEditor,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
description: value.description?,
display_name: value.display_name?,
docs_url: value.docs_url?,
homepage_url: value.homepage_url?,
slug: value.slug?,
})
}
}
impl ::std::convert::From<super::ManifestEditor> for ManifestEditor {
fn from(value: super::ManifestEditor) -> Self {
Self {
description: Ok(value.description),
display_name: Ok(value.display_name),
docs_url: Ok(value.docs_url),
homepage_url: Ok(value.homepage_url),
slug: Ok(value.slug),
}
}
}
#[derive(Clone, Debug)]
pub struct ManifestProcess {
command: ::std::result::Result<
::std::vec::Vec<super::ManifestProcessCommandItem>,
::std::string::String,
>,
cwd: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
env: ::std::result::Result<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
::std::string::String,
>,
health_check:
::std::result::Result<super::ManifestProcessHealthCheck, ::std::string::String>,
kill_timeout_ms: ::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
restart: ::std::result::Result<
::std::option::Option<super::ManifestProcessRestart>,
::std::string::String,
>,
restart_policy: ::std::result::Result<
::std::option::Option<super::ManifestProcessRestartPolicy>,
::std::string::String,
>,
start_timeout_ms: ::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
}
impl ::std::default::Default for ManifestProcess {
fn default() -> Self {
Self {
command: Err("no value supplied for command".to_string()),
cwd: Ok(Default::default()),
env: Ok(Default::default()),
health_check: Err("no value supplied for health_check".to_string()),
kill_timeout_ms: Ok(Default::default()),
restart: Ok(Default::default()),
restart_policy: Ok(Default::default()),
start_timeout_ms: Ok(Default::default()),
}
}
}
impl ManifestProcess {
pub fn command<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::ManifestProcessCommandItem>>,
T::Error: ::std::fmt::Display,
{
self.command = value
.try_into()
.map_err(|e| format!("error converting supplied value for command: {e}"));
self
}
pub fn cwd<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.cwd = value
.try_into()
.map_err(|e| format!("error converting supplied value for cwd: {e}"));
self
}
pub fn env<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
>,
T::Error: ::std::fmt::Display,
{
self.env = value
.try_into()
.map_err(|e| format!("error converting supplied value for env: {e}"));
self
}
pub fn health_check<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ManifestProcessHealthCheck>,
T::Error: ::std::fmt::Display,
{
self.health_check = value
.try_into()
.map_err(|e| format!("error converting supplied value for health_check: {e}"));
self
}
pub fn kill_timeout_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.kill_timeout_ms = value
.try_into()
.map_err(|e| format!("error converting supplied value for kill_timeout_ms: {e}"));
self
}
pub fn restart<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ManifestProcessRestart>>,
T::Error: ::std::fmt::Display,
{
self.restart = value
.try_into()
.map_err(|e| format!("error converting supplied value for restart: {e}"));
self
}
pub fn restart_policy<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ManifestProcessRestartPolicy>>,
T::Error: ::std::fmt::Display,
{
self.restart_policy = value
.try_into()
.map_err(|e| format!("error converting supplied value for restart_policy: {e}"));
self
}
pub fn start_timeout_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.start_timeout_ms = value
.try_into()
.map_err(|e| format!("error converting supplied value for start_timeout_ms: {e}"));
self
}
}
impl ::std::convert::TryFrom<ManifestProcess> for super::ManifestProcess {
type Error = super::error::ConversionError;
fn try_from(
value: ManifestProcess,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
command: value.command?,
cwd: value.cwd?,
env: value.env?,
health_check: value.health_check?,
kill_timeout_ms: value.kill_timeout_ms?,
restart: value.restart?,
restart_policy: value.restart_policy?,
start_timeout_ms: value.start_timeout_ms?,
})
}
}
impl ::std::convert::From<super::ManifestProcess> for ManifestProcess {
fn from(value: super::ManifestProcess) -> Self {
Self {
command: Ok(value.command),
cwd: Ok(value.cwd),
env: Ok(value.env),
health_check: Ok(value.health_check),
kill_timeout_ms: Ok(value.kill_timeout_ms),
restart: Ok(value.restart),
restart_policy: Ok(value.restart_policy),
start_timeout_ms: Ok(value.start_timeout_ms),
}
}
}
#[derive(Clone, Debug)]
pub struct ManifestProcessHealthCheck {
http: ::std::result::Result<super::ManifestProcessHealthCheckHttp, ::std::string::String>,
}
impl ::std::default::Default for ManifestProcessHealthCheck {
fn default() -> Self {
Self {
http: Err("no value supplied for http".to_string()),
}
}
}
impl ManifestProcessHealthCheck {
pub fn http<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ManifestProcessHealthCheckHttp>,
T::Error: ::std::fmt::Display,
{
self.http = value
.try_into()
.map_err(|e| format!("error converting supplied value for http: {e}"));
self
}
}
impl ::std::convert::TryFrom<ManifestProcessHealthCheck> for super::ManifestProcessHealthCheck {
type Error = super::error::ConversionError;
fn try_from(
value: ManifestProcessHealthCheck,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { http: value.http? })
}
}
impl ::std::convert::From<super::ManifestProcessHealthCheck> for ManifestProcessHealthCheck {
fn from(value: super::ManifestProcessHealthCheck) -> Self {
Self {
http: Ok(value.http),
}
}
}
#[derive(Clone, Debug)]
pub struct ManifestProcessHealthCheckHttp {
liveness_failure_threshold: ::std::result::Result<
::std::option::Option<::std::num::NonZeroU64>,
::std::string::String,
>,
liveness_period_ms:
::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
liveness_timeout_ms:
::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
path: ::std::result::Result<
::std::option::Option<super::ManifestProcessHealthCheckHttpPath>,
::std::string::String,
>,
port: ::std::result::Result<::std::num::NonZeroU64, ::std::string::String>,
startup_period_ms: ::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
startup_timeout_ms:
::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
}
impl ::std::default::Default for ManifestProcessHealthCheckHttp {
fn default() -> Self {
Self {
liveness_failure_threshold: Ok(Default::default()),
liveness_period_ms: Ok(Default::default()),
liveness_timeout_ms: Ok(Default::default()),
path: Ok(Default::default()),
port: Err("no value supplied for port".to_string()),
startup_period_ms: Ok(Default::default()),
startup_timeout_ms: Ok(Default::default()),
}
}
}
impl ManifestProcessHealthCheckHttp {
pub fn liveness_failure_threshold<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::num::NonZeroU64>>,
T::Error: ::std::fmt::Display,
{
self.liveness_failure_threshold = value.try_into().map_err(|e| {
format!("error converting supplied value for liveness_failure_threshold: {e}")
});
self
}
pub fn liveness_period_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.liveness_period_ms = value.try_into().map_err(|e| {
format!("error converting supplied value for liveness_period_ms: {e}")
});
self
}
pub fn liveness_timeout_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.liveness_timeout_ms = value.try_into().map_err(|e| {
format!("error converting supplied value for liveness_timeout_ms: {e}")
});
self
}
pub fn path<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::ManifestProcessHealthCheckHttpPath>,
>,
T::Error: ::std::fmt::Display,
{
self.path = value
.try_into()
.map_err(|e| format!("error converting supplied value for path: {e}"));
self
}
pub fn port<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::num::NonZeroU64>,
T::Error: ::std::fmt::Display,
{
self.port = value
.try_into()
.map_err(|e| format!("error converting supplied value for port: {e}"));
self
}
pub fn startup_period_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.startup_period_ms = value
.try_into()
.map_err(|e| format!("error converting supplied value for startup_period_ms: {e}"));
self
}
pub fn startup_timeout_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.startup_timeout_ms = value.try_into().map_err(|e| {
format!("error converting supplied value for startup_timeout_ms: {e}")
});
self
}
}
impl ::std::convert::TryFrom<ManifestProcessHealthCheckHttp>
for super::ManifestProcessHealthCheckHttp
{
type Error = super::error::ConversionError;
fn try_from(
value: ManifestProcessHealthCheckHttp,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
liveness_failure_threshold: value.liveness_failure_threshold?,
liveness_period_ms: value.liveness_period_ms?,
liveness_timeout_ms: value.liveness_timeout_ms?,
path: value.path?,
port: value.port?,
startup_period_ms: value.startup_period_ms?,
startup_timeout_ms: value.startup_timeout_ms?,
})
}
}
impl ::std::convert::From<super::ManifestProcessHealthCheckHttp>
for ManifestProcessHealthCheckHttp
{
fn from(value: super::ManifestProcessHealthCheckHttp) -> Self {
Self {
liveness_failure_threshold: Ok(value.liveness_failure_threshold),
liveness_period_ms: Ok(value.liveness_period_ms),
liveness_timeout_ms: Ok(value.liveness_timeout_ms),
path: Ok(value.path),
port: Ok(value.port),
startup_period_ms: Ok(value.startup_period_ms),
startup_timeout_ms: Ok(value.startup_timeout_ms),
}
}
}
#[derive(Clone, Debug)]
pub struct ManifestProcessRestartPolicy {
max_restarts: ::std::result::Result<
::std::option::Option<::std::num::NonZeroU64>,
::std::string::String,
>,
window_ms: ::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
}
impl ::std::default::Default for ManifestProcessRestartPolicy {
fn default() -> Self {
Self {
max_restarts: Ok(Default::default()),
window_ms: Ok(Default::default()),
}
}
}
impl ManifestProcessRestartPolicy {
pub fn max_restarts<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::num::NonZeroU64>>,
T::Error: ::std::fmt::Display,
{
self.max_restarts = value
.try_into()
.map_err(|e| format!("error converting supplied value for max_restarts: {e}"));
self
}
pub fn window_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.window_ms = value
.try_into()
.map_err(|e| format!("error converting supplied value for window_ms: {e}"));
self
}
}
impl ::std::convert::TryFrom<ManifestProcessRestartPolicy> for super::ManifestProcessRestartPolicy {
type Error = super::error::ConversionError;
fn try_from(
value: ManifestProcessRestartPolicy,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
max_restarts: value.max_restarts?,
window_ms: value.window_ms?,
})
}
}
impl ::std::convert::From<super::ManifestProcessRestartPolicy> for ManifestProcessRestartPolicy {
fn from(value: super::ManifestProcessRestartPolicy) -> Self {
Self {
max_restarts: Ok(value.max_restarts),
window_ms: Ok(value.window_ms),
}
}
}
#[derive(Clone, Debug)]
pub struct ManifestProvider {
display_name:
::std::result::Result<super::ManifestProviderDisplayName, ::std::string::String>,
endpoint_url: ::std::result::Result<::std::string::String, ::std::string::String>,
lifecycle_state: ::std::result::Result<
::std::option::Option<super::ManifestProviderLifecycleState>,
::std::string::String,
>,
region: ::std::result::Result<super::ManifestProviderRegion, ::std::string::String>,
slug: ::std::result::Result<super::ManifestProviderSlug, ::std::string::String>,
total_capacity_qps: ::std::result::Result<::std::num::NonZeroU64, ::std::string::String>,
}
impl ::std::default::Default for ManifestProvider {
fn default() -> Self {
Self {
display_name: Err("no value supplied for display_name".to_string()),
endpoint_url: Err("no value supplied for endpoint_url".to_string()),
lifecycle_state: Ok(Default::default()),
region: Err("no value supplied for region".to_string()),
slug: Err("no value supplied for slug".to_string()),
total_capacity_qps: Err("no value supplied for total_capacity_qps".to_string()),
}
}
}
impl ManifestProvider {
pub fn display_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ManifestProviderDisplayName>,
T::Error: ::std::fmt::Display,
{
self.display_name = value
.try_into()
.map_err(|e| format!("error converting supplied value for display_name: {e}"));
self
}
pub fn endpoint_url<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.endpoint_url = value
.try_into()
.map_err(|e| format!("error converting supplied value for endpoint_url: {e}"));
self
}
pub fn lifecycle_state<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::ManifestProviderLifecycleState>,
>,
T::Error: ::std::fmt::Display,
{
self.lifecycle_state = value
.try_into()
.map_err(|e| format!("error converting supplied value for lifecycle_state: {e}"));
self
}
pub fn region<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ManifestProviderRegion>,
T::Error: ::std::fmt::Display,
{
self.region = value
.try_into()
.map_err(|e| format!("error converting supplied value for region: {e}"));
self
}
pub fn slug<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ManifestProviderSlug>,
T::Error: ::std::fmt::Display,
{
self.slug = value
.try_into()
.map_err(|e| format!("error converting supplied value for slug: {e}"));
self
}
pub fn total_capacity_qps<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::num::NonZeroU64>,
T::Error: ::std::fmt::Display,
{
self.total_capacity_qps = value.try_into().map_err(|e| {
format!("error converting supplied value for total_capacity_qps: {e}")
});
self
}
}
impl ::std::convert::TryFrom<ManifestProvider> for super::ManifestProvider {
type Error = super::error::ConversionError;
fn try_from(
value: ManifestProvider,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
display_name: value.display_name?,
endpoint_url: value.endpoint_url?,
lifecycle_state: value.lifecycle_state?,
region: value.region?,
slug: value.slug?,
total_capacity_qps: value.total_capacity_qps?,
})
}
}
impl ::std::convert::From<super::ManifestProvider> for ManifestProvider {
fn from(value: super::ManifestProvider) -> Self {
Self {
display_name: Ok(value.display_name),
endpoint_url: Ok(value.endpoint_url),
lifecycle_state: Ok(value.lifecycle_state),
region: Ok(value.region),
slug: Ok(value.slug),
total_capacity_qps: Ok(value.total_capacity_qps),
}
}
}
#[derive(Clone, Debug)]
pub struct ManifestProviderV2 {
bindings: ::std::result::Result<::std::vec::Vec<super::BindingV2>, ::std::string::String>,
kind: ::std::result::Result<::std::string::String, ::std::string::String>,
providers:
::std::result::Result<::std::vec::Vec<super::ManifestProvider>, ::std::string::String>,
schema_version: ::std::result::Result<i64, ::std::string::String>,
tool_paths: ::std::result::Result<
::std::vec::Vec<super::ManifestProviderV2ToolPathsItem>,
::std::string::String,
>,
}
impl ::std::default::Default for ManifestProviderV2 {
fn default() -> Self {
Self {
bindings: Err("no value supplied for bindings".to_string()),
kind: Err("no value supplied for kind".to_string()),
providers: Err("no value supplied for providers".to_string()),
schema_version: Err("no value supplied for schema_version".to_string()),
tool_paths: Ok(Default::default()),
}
}
}
impl ManifestProviderV2 {
pub fn bindings<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::BindingV2>>,
T::Error: ::std::fmt::Display,
{
self.bindings = value
.try_into()
.map_err(|e| format!("error converting supplied value for bindings: {e}"));
self
}
pub fn kind<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.kind = value
.try_into()
.map_err(|e| format!("error converting supplied value for kind: {e}"));
self
}
pub fn providers<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::ManifestProvider>>,
T::Error: ::std::fmt::Display,
{
self.providers = value
.try_into()
.map_err(|e| format!("error converting supplied value for providers: {e}"));
self
}
pub fn schema_version<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.schema_version = value
.try_into()
.map_err(|e| format!("error converting supplied value for schema_version: {e}"));
self
}
pub fn tool_paths<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::ManifestProviderV2ToolPathsItem>>,
T::Error: ::std::fmt::Display,
{
self.tool_paths = value
.try_into()
.map_err(|e| format!("error converting supplied value for tool_paths: {e}"));
self
}
}
impl ::std::convert::TryFrom<ManifestProviderV2> for super::ManifestProviderV2 {
type Error = super::error::ConversionError;
fn try_from(
value: ManifestProviderV2,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
bindings: value.bindings?,
kind: value.kind?,
providers: value.providers?,
schema_version: value.schema_version?,
tool_paths: value.tool_paths?,
})
}
}
impl ::std::convert::From<super::ManifestProviderV2> for ManifestProviderV2 {
fn from(value: super::ManifestProviderV2) -> Self {
Self {
bindings: Ok(value.bindings),
kind: Ok(value.kind),
providers: Ok(value.providers),
schema_version: Ok(value.schema_version),
tool_paths: Ok(value.tool_paths),
}
}
}
#[derive(Clone, Debug)]
pub struct ManifestTool {
agents_supported:
::std::result::Result<::std::vec::Vec<::std::string::String>, ::std::string::String>,
capabilities: ::std::result::Result<
::std::vec::Vec<super::ManifestCapability>,
::std::string::String,
>,
description: ::std::result::Result<super::ManifestToolDescription, ::std::string::String>,
hooks_supported:
::std::result::Result<::std::vec::Vec<::std::string::String>, ::std::string::String>,
license: ::std::result::Result<super::ManifestToolLicense, ::std::string::String>,
lifecycle_state: ::std::result::Result<
::std::option::Option<super::ManifestToolLifecycleState>,
::std::string::String,
>,
slug: ::std::result::Result<super::ManifestToolSlug, ::std::string::String>,
version: ::std::result::Result<super::ManifestToolVersion, ::std::string::String>,
}
impl ::std::default::Default for ManifestTool {
fn default() -> Self {
Self {
agents_supported: Err("no value supplied for agents_supported".to_string()),
capabilities: Err("no value supplied for capabilities".to_string()),
description: Err("no value supplied for description".to_string()),
hooks_supported: Err("no value supplied for hooks_supported".to_string()),
license: Err("no value supplied for license".to_string()),
lifecycle_state: Ok(Default::default()),
slug: Err("no value supplied for slug".to_string()),
version: Err("no value supplied for version".to_string()),
}
}
}
impl ManifestTool {
pub fn agents_supported<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.agents_supported = value
.try_into()
.map_err(|e| format!("error converting supplied value for agents_supported: {e}"));
self
}
pub fn capabilities<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::ManifestCapability>>,
T::Error: ::std::fmt::Display,
{
self.capabilities = value
.try_into()
.map_err(|e| format!("error converting supplied value for capabilities: {e}"));
self
}
pub fn description<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ManifestToolDescription>,
T::Error: ::std::fmt::Display,
{
self.description = value
.try_into()
.map_err(|e| format!("error converting supplied value for description: {e}"));
self
}
pub fn hooks_supported<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.hooks_supported = value
.try_into()
.map_err(|e| format!("error converting supplied value for hooks_supported: {e}"));
self
}
pub fn license<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ManifestToolLicense>,
T::Error: ::std::fmt::Display,
{
self.license = value
.try_into()
.map_err(|e| format!("error converting supplied value for license: {e}"));
self
}
pub fn lifecycle_state<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ManifestToolLifecycleState>>,
T::Error: ::std::fmt::Display,
{
self.lifecycle_state = value
.try_into()
.map_err(|e| format!("error converting supplied value for lifecycle_state: {e}"));
self
}
pub fn slug<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ManifestToolSlug>,
T::Error: ::std::fmt::Display,
{
self.slug = value
.try_into()
.map_err(|e| format!("error converting supplied value for slug: {e}"));
self
}
pub fn version<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ManifestToolVersion>,
T::Error: ::std::fmt::Display,
{
self.version = value
.try_into()
.map_err(|e| format!("error converting supplied value for version: {e}"));
self
}
}
impl ::std::convert::TryFrom<ManifestTool> for super::ManifestTool {
type Error = super::error::ConversionError;
fn try_from(
value: ManifestTool,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
agents_supported: value.agents_supported?,
capabilities: value.capabilities?,
description: value.description?,
hooks_supported: value.hooks_supported?,
license: value.license?,
lifecycle_state: value.lifecycle_state?,
slug: value.slug?,
version: value.version?,
})
}
}
impl ::std::convert::From<super::ManifestTool> for ManifestTool {
fn from(value: super::ManifestTool) -> Self {
Self {
agents_supported: Ok(value.agents_supported),
capabilities: Ok(value.capabilities),
description: Ok(value.description),
hooks_supported: Ok(value.hooks_supported),
license: Ok(value.license),
lifecycle_state: Ok(value.lifecycle_state),
slug: Ok(value.slug),
version: Ok(value.version),
}
}
}
#[derive(Clone, Debug)]
pub struct ManifestToolV2 {
editor: ::std::result::Result<super::ManifestEditor, ::std::string::String>,
kind: ::std::result::Result<::std::string::String, ::std::string::String>,
schema_version: ::std::result::Result<i64, ::std::string::String>,
tools: ::std::result::Result<::std::vec::Vec<super::ToolItemV2>, ::std::string::String>,
}
impl ::std::default::Default for ManifestToolV2 {
fn default() -> Self {
Self {
editor: Err("no value supplied for editor".to_string()),
kind: Err("no value supplied for kind".to_string()),
schema_version: Err("no value supplied for schema_version".to_string()),
tools: Err("no value supplied for tools".to_string()),
}
}
}
impl ManifestToolV2 {
pub fn editor<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ManifestEditor>,
T::Error: ::std::fmt::Display,
{
self.editor = value
.try_into()
.map_err(|e| format!("error converting supplied value for editor: {e}"));
self
}
pub fn kind<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.kind = value
.try_into()
.map_err(|e| format!("error converting supplied value for kind: {e}"));
self
}
pub fn schema_version<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.schema_version = value
.try_into()
.map_err(|e| format!("error converting supplied value for schema_version: {e}"));
self
}
pub fn tools<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::ToolItemV2>>,
T::Error: ::std::fmt::Display,
{
self.tools = value
.try_into()
.map_err(|e| format!("error converting supplied value for tools: {e}"));
self
}
}
impl ::std::convert::TryFrom<ManifestToolV2> for super::ManifestToolV2 {
type Error = super::error::ConversionError;
fn try_from(
value: ManifestToolV2,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
editor: value.editor?,
kind: value.kind?,
schema_version: value.schema_version?,
tools: value.tools?,
})
}
}
impl ::std::convert::From<super::ManifestToolV2> for ManifestToolV2 {
fn from(value: super::ManifestToolV2) -> Self {
Self {
editor: Ok(value.editor),
kind: Ok(value.kind),
schema_version: Ok(value.schema_version),
tools: Ok(value.tools),
}
}
}
#[derive(Clone, Debug)]
pub struct ProcessOverrideV2 {
command: ::std::result::Result<
::std::vec::Vec<super::ProcessOverrideV2CommandItem>,
::std::string::String,
>,
command_args:
::std::result::Result<::std::vec::Vec<::std::string::String>, ::std::string::String>,
cwd: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
env: ::std::result::Result<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
::std::string::String,
>,
health_check: ::std::result::Result<
::std::option::Option<super::ProcessOverrideV2HealthCheck>,
::std::string::String,
>,
restart: ::std::result::Result<
::std::option::Option<super::ProcessOverrideV2Restart>,
::std::string::String,
>,
}
impl ::std::default::Default for ProcessOverrideV2 {
fn default() -> Self {
Self {
command: Ok(Default::default()),
command_args: Ok(Default::default()),
cwd: Ok(Default::default()),
env: Ok(Default::default()),
health_check: Ok(Default::default()),
restart: Ok(Default::default()),
}
}
}
impl ProcessOverrideV2 {
pub fn command<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::ProcessOverrideV2CommandItem>>,
T::Error: ::std::fmt::Display,
{
self.command = value
.try_into()
.map_err(|e| format!("error converting supplied value for command: {e}"));
self
}
pub fn command_args<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.command_args = value
.try_into()
.map_err(|e| format!("error converting supplied value for command_args: {e}"));
self
}
pub fn cwd<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.cwd = value
.try_into()
.map_err(|e| format!("error converting supplied value for cwd: {e}"));
self
}
pub fn env<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
>,
T::Error: ::std::fmt::Display,
{
self.env = value
.try_into()
.map_err(|e| format!("error converting supplied value for env: {e}"));
self
}
pub fn health_check<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ProcessOverrideV2HealthCheck>>,
T::Error: ::std::fmt::Display,
{
self.health_check = value
.try_into()
.map_err(|e| format!("error converting supplied value for health_check: {e}"));
self
}
pub fn restart<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ProcessOverrideV2Restart>>,
T::Error: ::std::fmt::Display,
{
self.restart = value
.try_into()
.map_err(|e| format!("error converting supplied value for restart: {e}"));
self
}
}
impl ::std::convert::TryFrom<ProcessOverrideV2> for super::ProcessOverrideV2 {
type Error = super::error::ConversionError;
fn try_from(
value: ProcessOverrideV2,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
command: value.command?,
command_args: value.command_args?,
cwd: value.cwd?,
env: value.env?,
health_check: value.health_check?,
restart: value.restart?,
})
}
}
impl ::std::convert::From<super::ProcessOverrideV2> for ProcessOverrideV2 {
fn from(value: super::ProcessOverrideV2) -> Self {
Self {
command: Ok(value.command),
command_args: Ok(value.command_args),
cwd: Ok(value.cwd),
env: Ok(value.env),
health_check: Ok(value.health_check),
restart: Ok(value.restart),
}
}
}
#[derive(Clone, Debug)]
pub struct ProcessOverrideV2HealthCheck {
http: ::std::result::Result<super::ProcessOverrideV2HealthCheckHttp, ::std::string::String>,
}
impl ::std::default::Default for ProcessOverrideV2HealthCheck {
fn default() -> Self {
Self {
http: Err("no value supplied for http".to_string()),
}
}
}
impl ProcessOverrideV2HealthCheck {
pub fn http<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ProcessOverrideV2HealthCheckHttp>,
T::Error: ::std::fmt::Display,
{
self.http = value
.try_into()
.map_err(|e| format!("error converting supplied value for http: {e}"));
self
}
}
impl ::std::convert::TryFrom<ProcessOverrideV2HealthCheck> for super::ProcessOverrideV2HealthCheck {
type Error = super::error::ConversionError;
fn try_from(
value: ProcessOverrideV2HealthCheck,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { http: value.http? })
}
}
impl ::std::convert::From<super::ProcessOverrideV2HealthCheck> for ProcessOverrideV2HealthCheck {
fn from(value: super::ProcessOverrideV2HealthCheck) -> Self {
Self {
http: Ok(value.http),
}
}
}
#[derive(Clone, Debug)]
pub struct ProcessOverrideV2HealthCheckHttp {
liveness_failure_threshold: ::std::result::Result<
::std::option::Option<::std::num::NonZeroU64>,
::std::string::String,
>,
liveness_period_ms:
::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
liveness_timeout_ms:
::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
path: ::std::result::Result<
::std::option::Option<super::ProcessOverrideV2HealthCheckHttpPath>,
::std::string::String,
>,
port: ::std::result::Result<::std::num::NonZeroU64, ::std::string::String>,
startup_period_ms: ::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
startup_timeout_ms:
::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
}
impl ::std::default::Default for ProcessOverrideV2HealthCheckHttp {
fn default() -> Self {
Self {
liveness_failure_threshold: Ok(Default::default()),
liveness_period_ms: Ok(Default::default()),
liveness_timeout_ms: Ok(Default::default()),
path: Ok(Default::default()),
port: Err("no value supplied for port".to_string()),
startup_period_ms: Ok(Default::default()),
startup_timeout_ms: Ok(Default::default()),
}
}
}
impl ProcessOverrideV2HealthCheckHttp {
pub fn liveness_failure_threshold<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::num::NonZeroU64>>,
T::Error: ::std::fmt::Display,
{
self.liveness_failure_threshold = value.try_into().map_err(|e| {
format!("error converting supplied value for liveness_failure_threshold: {e}")
});
self
}
pub fn liveness_period_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.liveness_period_ms = value.try_into().map_err(|e| {
format!("error converting supplied value for liveness_period_ms: {e}")
});
self
}
pub fn liveness_timeout_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.liveness_timeout_ms = value.try_into().map_err(|e| {
format!("error converting supplied value for liveness_timeout_ms: {e}")
});
self
}
pub fn path<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::ProcessOverrideV2HealthCheckHttpPath>,
>,
T::Error: ::std::fmt::Display,
{
self.path = value
.try_into()
.map_err(|e| format!("error converting supplied value for path: {e}"));
self
}
pub fn port<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::num::NonZeroU64>,
T::Error: ::std::fmt::Display,
{
self.port = value
.try_into()
.map_err(|e| format!("error converting supplied value for port: {e}"));
self
}
pub fn startup_period_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.startup_period_ms = value
.try_into()
.map_err(|e| format!("error converting supplied value for startup_period_ms: {e}"));
self
}
pub fn startup_timeout_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.startup_timeout_ms = value.try_into().map_err(|e| {
format!("error converting supplied value for startup_timeout_ms: {e}")
});
self
}
}
impl ::std::convert::TryFrom<ProcessOverrideV2HealthCheckHttp>
for super::ProcessOverrideV2HealthCheckHttp
{
type Error = super::error::ConversionError;
fn try_from(
value: ProcessOverrideV2HealthCheckHttp,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
liveness_failure_threshold: value.liveness_failure_threshold?,
liveness_period_ms: value.liveness_period_ms?,
liveness_timeout_ms: value.liveness_timeout_ms?,
path: value.path?,
port: value.port?,
startup_period_ms: value.startup_period_ms?,
startup_timeout_ms: value.startup_timeout_ms?,
})
}
}
impl ::std::convert::From<super::ProcessOverrideV2HealthCheckHttp>
for ProcessOverrideV2HealthCheckHttp
{
fn from(value: super::ProcessOverrideV2HealthCheckHttp) -> Self {
Self {
liveness_failure_threshold: Ok(value.liveness_failure_threshold),
liveness_period_ms: Ok(value.liveness_period_ms),
liveness_timeout_ms: Ok(value.liveness_timeout_ms),
path: Ok(value.path),
port: Ok(value.port),
startup_period_ms: Ok(value.startup_period_ms),
startup_timeout_ms: Ok(value.startup_timeout_ms),
}
}
}
#[derive(Clone, Debug)]
pub struct ProcessOverrideV2Restart {
max_restarts: ::std::result::Result<
::std::option::Option<::std::num::NonZeroU64>,
::std::string::String,
>,
window_seconds: ::std::result::Result<
::std::option::Option<::std::num::NonZeroU64>,
::std::string::String,
>,
}
impl ::std::default::Default for ProcessOverrideV2Restart {
fn default() -> Self {
Self {
max_restarts: Ok(Default::default()),
window_seconds: Ok(Default::default()),
}
}
}
impl ProcessOverrideV2Restart {
pub fn max_restarts<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::num::NonZeroU64>>,
T::Error: ::std::fmt::Display,
{
self.max_restarts = value
.try_into()
.map_err(|e| format!("error converting supplied value for max_restarts: {e}"));
self
}
pub fn window_seconds<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::num::NonZeroU64>>,
T::Error: ::std::fmt::Display,
{
self.window_seconds = value
.try_into()
.map_err(|e| format!("error converting supplied value for window_seconds: {e}"));
self
}
}
impl ::std::convert::TryFrom<ProcessOverrideV2Restart> for super::ProcessOverrideV2Restart {
type Error = super::error::ConversionError;
fn try_from(
value: ProcessOverrideV2Restart,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
max_restarts: value.max_restarts?,
window_seconds: value.window_seconds?,
})
}
}
impl ::std::convert::From<super::ProcessOverrideV2Restart> for ProcessOverrideV2Restart {
fn from(value: super::ProcessOverrideV2Restart) -> Self {
Self {
max_restarts: Ok(value.max_restarts),
window_seconds: Ok(value.window_seconds),
}
}
}
#[derive(Clone, Debug)]
pub struct ProcessV2 {
command: ::std::result::Result<
::std::vec::Vec<super::ProcessV2CommandItem>,
::std::string::String,
>,
cwd: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
env: ::std::result::Result<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
::std::string::String,
>,
health_check: ::std::result::Result<super::HealthCheckV2, ::std::string::String>,
kill_timeout_ms: ::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
restart: ::std::result::Result<
::std::option::Option<super::RestartLimitV2>,
::std::string::String,
>,
start_timeout_ms: ::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
}
impl ::std::default::Default for ProcessV2 {
fn default() -> Self {
Self {
command: Err("no value supplied for command".to_string()),
cwd: Ok(Default::default()),
env: Ok(Default::default()),
health_check: Err("no value supplied for health_check".to_string()),
kill_timeout_ms: Ok(Default::default()),
restart: Ok(Default::default()),
start_timeout_ms: Ok(Default::default()),
}
}
}
impl ProcessV2 {
pub fn command<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::ProcessV2CommandItem>>,
T::Error: ::std::fmt::Display,
{
self.command = value
.try_into()
.map_err(|e| format!("error converting supplied value for command: {e}"));
self
}
pub fn cwd<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.cwd = value
.try_into()
.map_err(|e| format!("error converting supplied value for cwd: {e}"));
self
}
pub fn env<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
>,
T::Error: ::std::fmt::Display,
{
self.env = value
.try_into()
.map_err(|e| format!("error converting supplied value for env: {e}"));
self
}
pub fn health_check<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::HealthCheckV2>,
T::Error: ::std::fmt::Display,
{
self.health_check = value
.try_into()
.map_err(|e| format!("error converting supplied value for health_check: {e}"));
self
}
pub fn kill_timeout_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.kill_timeout_ms = value
.try_into()
.map_err(|e| format!("error converting supplied value for kill_timeout_ms: {e}"));
self
}
pub fn restart<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::RestartLimitV2>>,
T::Error: ::std::fmt::Display,
{
self.restart = value
.try_into()
.map_err(|e| format!("error converting supplied value for restart: {e}"));
self
}
pub fn start_timeout_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.start_timeout_ms = value
.try_into()
.map_err(|e| format!("error converting supplied value for start_timeout_ms: {e}"));
self
}
}
impl ::std::convert::TryFrom<ProcessV2> for super::ProcessV2 {
type Error = super::error::ConversionError;
fn try_from(
value: ProcessV2,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
command: value.command?,
cwd: value.cwd?,
env: value.env?,
health_check: value.health_check?,
kill_timeout_ms: value.kill_timeout_ms?,
restart: value.restart?,
start_timeout_ms: value.start_timeout_ms?,
})
}
}
impl ::std::convert::From<super::ProcessV2> for ProcessV2 {
fn from(value: super::ProcessV2) -> Self {
Self {
command: Ok(value.command),
cwd: Ok(value.cwd),
env: Ok(value.env),
health_check: Ok(value.health_check),
kill_timeout_ms: Ok(value.kill_timeout_ms),
restart: Ok(value.restart),
start_timeout_ms: Ok(value.start_timeout_ms),
}
}
}
#[derive(Clone, Debug)]
pub struct RestartLimitV2 {
max_restarts: ::std::result::Result<
::std::option::Option<::std::num::NonZeroU64>,
::std::string::String,
>,
window_seconds: ::std::result::Result<
::std::option::Option<::std::num::NonZeroU64>,
::std::string::String,
>,
}
impl ::std::default::Default for RestartLimitV2 {
fn default() -> Self {
Self {
max_restarts: Ok(Default::default()),
window_seconds: Ok(Default::default()),
}
}
}
impl RestartLimitV2 {
pub fn max_restarts<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::num::NonZeroU64>>,
T::Error: ::std::fmt::Display,
{
self.max_restarts = value
.try_into()
.map_err(|e| format!("error converting supplied value for max_restarts: {e}"));
self
}
pub fn window_seconds<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::num::NonZeroU64>>,
T::Error: ::std::fmt::Display,
{
self.window_seconds = value
.try_into()
.map_err(|e| format!("error converting supplied value for window_seconds: {e}"));
self
}
}
impl ::std::convert::TryFrom<RestartLimitV2> for super::RestartLimitV2 {
type Error = super::error::ConversionError;
fn try_from(
value: RestartLimitV2,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
max_restarts: value.max_restarts?,
window_seconds: value.window_seconds?,
})
}
}
impl ::std::convert::From<super::RestartLimitV2> for RestartLimitV2 {
fn from(value: super::RestartLimitV2) -> Self {
Self {
max_restarts: Ok(value.max_restarts),
window_seconds: Ok(value.window_seconds),
}
}
}
#[derive(Clone, Debug)]
pub struct ToolItemV2 {
agents_supported:
::std::result::Result<::std::vec::Vec<::std::string::String>, ::std::string::String>,
capabilities: ::std::result::Result<
::std::vec::Vec<super::ManifestCapability>,
::std::string::String,
>,
description: ::std::result::Result<super::ToolItemV2Description, ::std::string::String>,
hooks_supported:
::std::result::Result<::std::vec::Vec<::std::string::String>, ::std::string::String>,
license: ::std::result::Result<super::ToolItemV2License, ::std::string::String>,
lifecycle_state: ::std::result::Result<
::std::option::Option<super::ToolItemV2LifecycleState>,
::std::string::String,
>,
process: ::std::result::Result<super::ProcessV2, ::std::string::String>,
slug: ::std::result::Result<super::ToolItemV2Slug, ::std::string::String>,
version: ::std::result::Result<super::ToolItemV2Version, ::std::string::String>,
}
impl ::std::default::Default for ToolItemV2 {
fn default() -> Self {
Self {
agents_supported: Err("no value supplied for agents_supported".to_string()),
capabilities: Err("no value supplied for capabilities".to_string()),
description: Err("no value supplied for description".to_string()),
hooks_supported: Err("no value supplied for hooks_supported".to_string()),
license: Err("no value supplied for license".to_string()),
lifecycle_state: Ok(Default::default()),
process: Err("no value supplied for process".to_string()),
slug: Err("no value supplied for slug".to_string()),
version: Err("no value supplied for version".to_string()),
}
}
}
impl ToolItemV2 {
pub fn agents_supported<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.agents_supported = value
.try_into()
.map_err(|e| format!("error converting supplied value for agents_supported: {e}"));
self
}
pub fn capabilities<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::ManifestCapability>>,
T::Error: ::std::fmt::Display,
{
self.capabilities = value
.try_into()
.map_err(|e| format!("error converting supplied value for capabilities: {e}"));
self
}
pub fn description<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ToolItemV2Description>,
T::Error: ::std::fmt::Display,
{
self.description = value
.try_into()
.map_err(|e| format!("error converting supplied value for description: {e}"));
self
}
pub fn hooks_supported<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.hooks_supported = value
.try_into()
.map_err(|e| format!("error converting supplied value for hooks_supported: {e}"));
self
}
pub fn license<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ToolItemV2License>,
T::Error: ::std::fmt::Display,
{
self.license = value
.try_into()
.map_err(|e| format!("error converting supplied value for license: {e}"));
self
}
pub fn lifecycle_state<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ToolItemV2LifecycleState>>,
T::Error: ::std::fmt::Display,
{
self.lifecycle_state = value
.try_into()
.map_err(|e| format!("error converting supplied value for lifecycle_state: {e}"));
self
}
pub fn process<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ProcessV2>,
T::Error: ::std::fmt::Display,
{
self.process = value
.try_into()
.map_err(|e| format!("error converting supplied value for process: {e}"));
self
}
pub fn slug<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ToolItemV2Slug>,
T::Error: ::std::fmt::Display,
{
self.slug = value
.try_into()
.map_err(|e| format!("error converting supplied value for slug: {e}"));
self
}
pub fn version<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ToolItemV2Version>,
T::Error: ::std::fmt::Display,
{
self.version = value
.try_into()
.map_err(|e| format!("error converting supplied value for version: {e}"));
self
}
}
impl ::std::convert::TryFrom<ToolItemV2> for super::ToolItemV2 {
type Error = super::error::ConversionError;
fn try_from(
value: ToolItemV2,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
agents_supported: value.agents_supported?,
capabilities: value.capabilities?,
description: value.description?,
hooks_supported: value.hooks_supported?,
license: value.license?,
lifecycle_state: value.lifecycle_state?,
process: value.process?,
slug: value.slug?,
version: value.version?,
})
}
}
impl ::std::convert::From<super::ToolItemV2> for ToolItemV2 {
fn from(value: super::ToolItemV2) -> Self {
Self {
agents_supported: Ok(value.agents_supported),
capabilities: Ok(value.capabilities),
description: Ok(value.description),
hooks_supported: Ok(value.hooks_supported),
license: Ok(value.license),
lifecycle_state: Ok(value.lifecycle_state),
process: Ok(value.process),
slug: Ok(value.slug),
version: Ok(value.version),
}
}
}
#[derive(Clone, Debug)]
pub struct VerdictResponse {
context: ::std::result::Result<
::std::option::Option<super::VerdictResponseContext>,
::std::string::String,
>,
details_url: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
event_id: ::std::result::Result<::std::string::String, ::std::string::String>,
latency_ms: ::std::result::Result<f64, ::std::string::String>,
offline: ::std::result::Result<::std::option::Option<bool>, ::std::string::String>,
reason: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
rule_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
schema_version: ::std::result::Result<::std::string::String, ::std::string::String>,
severity: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
threat_category: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
verdict: ::std::result::Result<super::Verdict, ::std::string::String>,
}
impl ::std::default::Default for VerdictResponse {
fn default() -> Self {
Self {
context: Ok(Default::default()),
details_url: Ok(Default::default()),
event_id: Err("no value supplied for event_id".to_string()),
latency_ms: Err("no value supplied for latency_ms".to_string()),
offline: Ok(Default::default()),
reason: Ok(Default::default()),
rule_id: Ok(Default::default()),
schema_version: Err("no value supplied for schema_version".to_string()),
severity: Ok(Default::default()),
threat_category: Ok(Default::default()),
verdict: Err("no value supplied for verdict".to_string()),
}
}
}
impl VerdictResponse {
pub fn context<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::VerdictResponseContext>>,
T::Error: ::std::fmt::Display,
{
self.context = value
.try_into()
.map_err(|e| format!("error converting supplied value for context: {e}"));
self
}
pub fn details_url<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.details_url = value
.try_into()
.map_err(|e| format!("error converting supplied value for details_url: {e}"));
self
}
pub fn event_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.event_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for event_id: {e}"));
self
}
pub fn latency_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<f64>,
T::Error: ::std::fmt::Display,
{
self.latency_ms = value
.try_into()
.map_err(|e| format!("error converting supplied value for latency_ms: {e}"));
self
}
pub fn offline<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.offline = value
.try_into()
.map_err(|e| format!("error converting supplied value for offline: {e}"));
self
}
pub fn reason<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.reason = value
.try_into()
.map_err(|e| format!("error converting supplied value for reason: {e}"));
self
}
pub fn rule_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.rule_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rule_id: {e}"));
self
}
pub fn schema_version<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.schema_version = value
.try_into()
.map_err(|e| format!("error converting supplied value for schema_version: {e}"));
self
}
pub fn severity<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.severity = value
.try_into()
.map_err(|e| format!("error converting supplied value for severity: {e}"));
self
}
pub fn threat_category<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.threat_category = value
.try_into()
.map_err(|e| format!("error converting supplied value for threat_category: {e}"));
self
}
pub fn verdict<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Verdict>,
T::Error: ::std::fmt::Display,
{
self.verdict = value
.try_into()
.map_err(|e| format!("error converting supplied value for verdict: {e}"));
self
}
}
impl ::std::convert::TryFrom<VerdictResponse> for super::VerdictResponse {
type Error = super::error::ConversionError;
fn try_from(
value: VerdictResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
context: value.context?,
details_url: value.details_url?,
event_id: value.event_id?,
latency_ms: value.latency_ms?,
offline: value.offline?,
reason: value.reason?,
rule_id: value.rule_id?,
schema_version: value.schema_version?,
severity: value.severity?,
threat_category: value.threat_category?,
verdict: value.verdict?,
})
}
}
impl ::std::convert::From<super::VerdictResponse> for VerdictResponse {
fn from(value: super::VerdictResponse) -> Self {
Self {
context: Ok(value.context),
details_url: Ok(value.details_url),
event_id: Ok(value.event_id),
latency_ms: Ok(value.latency_ms),
offline: Ok(value.offline),
reason: Ok(value.reason),
rule_id: Ok(value.rule_id),
schema_version: Ok(value.schema_version),
severity: Ok(value.severity),
threat_category: Ok(value.threat_category),
verdict: Ok(value.verdict),
}
}
}
#[derive(Clone, Debug)]
pub struct VerdictResponseContext {
body: ::std::result::Result<super::VerdictResponseContextBody, ::std::string::String>,
evidence: ::std::result::Result<
::std::vec::Vec<super::VerdictResponseContextEvidenceItem>,
::std::string::String,
>,
headline:
::std::result::Result<super::VerdictResponseContextHeadline, ::std::string::String>,
}
impl ::std::default::Default for VerdictResponseContext {
fn default() -> Self {
Self {
body: Err("no value supplied for body".to_string()),
evidence: Ok(Default::default()),
headline: Err("no value supplied for headline".to_string()),
}
}
}
impl VerdictResponseContext {
pub fn body<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::VerdictResponseContextBody>,
T::Error: ::std::fmt::Display,
{
self.body = value
.try_into()
.map_err(|e| format!("error converting supplied value for body: {e}"));
self
}
pub fn evidence<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::VerdictResponseContextEvidenceItem>>,
T::Error: ::std::fmt::Display,
{
self.evidence = value
.try_into()
.map_err(|e| format!("error converting supplied value for evidence: {e}"));
self
}
pub fn headline<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::VerdictResponseContextHeadline>,
T::Error: ::std::fmt::Display,
{
self.headline = value
.try_into()
.map_err(|e| format!("error converting supplied value for headline: {e}"));
self
}
}
impl ::std::convert::TryFrom<VerdictResponseContext> for super::VerdictResponseContext {
type Error = super::error::ConversionError;
fn try_from(
value: VerdictResponseContext,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
body: value.body?,
evidence: value.evidence?,
headline: value.headline?,
})
}
}
impl ::std::convert::From<super::VerdictResponseContext> for VerdictResponseContext {
fn from(value: super::VerdictResponseContext) -> Self {
Self {
body: Ok(value.body),
evidence: Ok(value.evidence),
headline: Ok(value.headline),
}
}
}
#[derive(Clone, Debug)]
pub struct VerdictResponseContextEvidenceItem {
label: ::std::result::Result<
super::VerdictResponseContextEvidenceItemLabel,
::std::string::String,
>,
value_redacted: ::std::result::Result<
::std::option::Option<super::VerdictResponseContextEvidenceItemValueRedacted>,
::std::string::String,
>,
}
impl ::std::default::Default for VerdictResponseContextEvidenceItem {
fn default() -> Self {
Self {
label: Err("no value supplied for label".to_string()),
value_redacted: Ok(Default::default()),
}
}
}
impl VerdictResponseContextEvidenceItem {
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::VerdictResponseContextEvidenceItemLabel>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn value_redacted<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::VerdictResponseContextEvidenceItemValueRedacted>,
>,
T::Error: ::std::fmt::Display,
{
self.value_redacted = value
.try_into()
.map_err(|e| format!("error converting supplied value for value_redacted: {e}"));
self
}
}
impl ::std::convert::TryFrom<VerdictResponseContextEvidenceItem>
for super::VerdictResponseContextEvidenceItem
{
type Error = super::error::ConversionError;
fn try_from(
value: VerdictResponseContextEvidenceItem,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
label: value.label?,
value_redacted: value.value_redacted?,
})
}
}
impl ::std::convert::From<super::VerdictResponseContextEvidenceItem>
for VerdictResponseContextEvidenceItem
{
fn from(value: super::VerdictResponseContextEvidenceItem) -> Self {
Self {
label: Ok(value.label),
value_redacted: Ok(value.value_redacted),
}
}
}
}