// 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()
}
}
///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()
}
}
///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",
/// "endpoint_url",
/// "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
/// },
/// "endpoint_url": {
/// "description": "Public HTTPS URL where the platform sends events.",
/// "type": "string",
/// "format": "uri",
/// "pattern": "^https://"
/// },
/// "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
/// },
/// "provider": {
/// "description": "Slug of a provider defined in `providers[]`.",
/// "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,
///Public HTTPS URL where the platform sends events.
pub endpoint_url: ::std::string::String,
///(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,
///Slug of a provider defined in `providers[]`.
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_raw_payload": {
/// "description": "If true, the platform skips built-in redactors before forwarding the event.",
/// "type": "boolean"
/// },
/// "threat_category": {
/// "type": "string",
/// "enum": [
/// "pii_outbound",
/// "credential_detection",
/// "tool_poison_detection",
/// "shell_dangerous",
/// "injection_tool_response",
/// "injection_user_input",
/// "attack_path_analysis",
/// "behavioral_anomaly",
/// "data_exfiltration",
/// "privilege_escalation",
/// "unauthorized_resource_access",
/// "policy_violation"
/// ]
/// }
/// },
/// "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 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",
/// "credential_detection",
/// "tool_poison_detection",
/// "shell_dangerous",
/// "injection_tool_response",
/// "injection_user_input",
/// "attack_path_analysis",
/// "behavioral_anomaly",
/// "data_exfiltration",
/// "privilege_escalation",
/// "unauthorized_resource_access",
/// "policy_violation"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ManifestCapabilityThreatCategory {
#[serde(rename = "pii_outbound")]
PiiOutbound,
#[serde(rename = "credential_detection")]
CredentialDetection,
#[serde(rename = "tool_poison_detection")]
ToolPoisonDetection,
#[serde(rename = "shell_dangerous")]
ShellDangerous,
#[serde(rename = "injection_tool_response")]
InjectionToolResponse,
#[serde(rename = "injection_user_input")]
InjectionUserInput,
#[serde(rename = "attack_path_analysis")]
AttackPathAnalysis,
#[serde(rename = "behavioral_anomaly")]
BehavioralAnomaly,
#[serde(rename = "data_exfiltration")]
DataExfiltration,
#[serde(rename = "privilege_escalation")]
PrivilegeEscalation,
#[serde(rename = "unauthorized_resource_access")]
UnauthorizedResourceAccess,
#[serde(rename = "policy_violation")]
PolicyViolation,
}
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::CredentialDetection => f.write_str("credential_detection"),
Self::ToolPoisonDetection => f.write_str("tool_poison_detection"),
Self::ShellDangerous => f.write_str("shell_dangerous"),
Self::InjectionToolResponse => f.write_str("injection_tool_response"),
Self::InjectionUserInput => f.write_str("injection_user_input"),
Self::AttackPathAnalysis => f.write_str("attack_path_analysis"),
Self::BehavioralAnomaly => f.write_str("behavioral_anomaly"),
Self::DataExfiltration => f.write_str("data_exfiltration"),
Self::PrivilegeEscalation => f.write_str("privilege_escalation"),
Self::UnauthorizedResourceAccess => f.write_str("unauthorized_resource_access"),
Self::PolicyViolation => f.write_str("policy_violation"),
}
}
}
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),
"credential_detection" => Ok(Self::CredentialDetection),
"tool_poison_detection" => Ok(Self::ToolPoisonDetection),
"shell_dangerous" => Ok(Self::ShellDangerous),
"injection_tool_response" => Ok(Self::InjectionToolResponse),
"injection_user_input" => Ok(Self::InjectionUserInput),
"attack_path_analysis" => Ok(Self::AttackPathAnalysis),
"behavioral_anomaly" => Ok(Self::BehavioralAnomaly),
"data_exfiltration" => Ok(Self::DataExfiltration),
"privilege_escalation" => Ok(Self::PrivilegeEscalation),
"unauthorized_resource_access" => Ok(Self::UnauthorizedResourceAccess),
"policy_violation" => Ok(Self::PolicyViolation),
_ => 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())
})
}
}
///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",
/// "region",
/// "slug",
/// "total_capacity_qps"
/// ],
/// "properties": {
/// "display_name": {
/// "type": "string",
/// "maxLength": 200,
/// "minLength": 1
/// },
/// "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,
#[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())
})
}
}
///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())
})
}
}
///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)
}
}
///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 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 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>,
endpoint_url: ::std::result::Result<::std::string::String, ::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>,
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()
),
endpoint_url: Err("no value supplied for endpoint_url".to_string()),
local_endpoint: Ok(Default::default()),
pricing: Ok(Default::default()),
priority: Err("no value supplied for priority".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 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 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 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?,
endpoint_url: value.endpoint_url?,
local_endpoint: value.local_endpoint?,
pricing: value.pricing?,
priority: value.priority?,
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),
endpoint_url: Ok(value.endpoint_url),
local_endpoint: Ok(value.local_endpoint),
pricing: Ok(value.pricing),
priority: Ok(value.priority),
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_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_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_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_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_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 ManifestProvider {
display_name:
::std::result::Result<super::ManifestProviderDisplayName, ::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()),
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 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?,
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),
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 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 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),
}
}
}
}