#[allow(unused_imports)]
pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue};
#[allow(unused_imports)]
use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderExt};
/// Types used as operation parameters and responses.
#[allow(clippy::all)]
pub mod types {
/// 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())
}
}
}
/**How much of a connection a share admits (RFC 0002), judged on each action's
classified [`ActionAccess`].*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "How much of a connection a share admits (RFC 0002), judged on each action's\nclassified [`ActionAccess`].",
/// "type": "string",
/// "enum": [
/// "none",
/// "read",
/// "write",
/// "read_write",
/// "full",
/// "custom"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum AccessLevel {
#[serde(rename = "none")]
None,
#[serde(rename = "read")]
Read,
#[serde(rename = "write")]
Write,
#[serde(rename = "read_write")]
ReadWrite,
#[serde(rename = "full")]
Full,
#[serde(rename = "custom")]
Custom,
}
impl ::std::fmt::Display for AccessLevel {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::None => f.write_str("none"),
Self::Read => f.write_str("read"),
Self::Write => f.write_str("write"),
Self::ReadWrite => f.write_str("read_write"),
Self::Full => f.write_str("full"),
Self::Custom => f.write_str("custom"),
}
}
}
impl ::std::str::FromStr for AccessLevel {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"none" => Ok(Self::None),
"read" => Ok(Self::Read),
"write" => Ok(Self::Write),
"read_write" => Ok(Self::ReadWrite),
"full" => Ok(Self::Full),
"custom" => Ok(Self::Custom),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for AccessLevel {
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 AccessLevel {
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 AccessLevel {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
/**The least access an action needs to run, judged by what it does to the
remote system rather than by the HTTP method it goes out on: a POST search
is `Read`, a POST bulk delete is `Delete`.
The variants are declared least to most, so `Ord` is the access order
itself: `max` of two levels is the one that admits less, which is the safe
side to land on when a judgement is not clear cut.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The least access an action needs to run, judged by what it does to the\nremote system rather than by the HTTP method it goes out on: a POST search\nis `Read`, a POST bulk delete is `Delete`.\n\nThe variants are declared least to most, so `Ord` is the access order\nitself: `max` of two levels is the one that admits less, which is the safe\nside to land on when a judgement is not clear cut.",
/// "type": "string",
/// "enum": [
/// "read",
/// "write",
/// "delete"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum ActionAccess {
#[serde(rename = "read")]
Read,
#[serde(rename = "write")]
Write,
#[serde(rename = "delete")]
Delete,
}
impl ::std::fmt::Display for ActionAccess {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Read => f.write_str("read"),
Self::Write => f.write_str("write"),
Self::Delete => f.write_str("delete"),
}
}
}
impl ::std::str::FromStr for ActionAccess {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"read" => Ok(Self::Read),
"write" => Ok(Self::Write),
"delete" => Ok(Self::Delete),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ActionAccess {
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 ActionAccess {
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 ActionAccess {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
/**Identifies the key without ever carrying its material - the secret exists
only in the create response, never in a delivery.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Identifies the key without ever carrying its material - the secret exists\nonly in the create response, never in a delivery.",
/// "type": "object",
/// "required": [
/// "connection_type",
/// "created_at",
/// "environment",
/// "event_access_id"
/// ],
/// "properties": {
/// "connection_type": {
/// "type": "string"
/// },
/// "created_at": {
/// "type": "string",
/// "format": "date-time"
/// },
/// "environment": {
/// "type": "string"
/// },
/// "event_access_id": {
/// "type": "string"
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "organization_id": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "project_id": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ApiKeyCreatedPayload {
pub connection_type: ::std::string::String,
pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
pub environment: ::std::string::String,
pub event_access_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub project_id: ::std::option::Option<::uuid::Uuid>,
}
///`ApiKeyRevokedPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "connection_type",
/// "environment",
/// "event_access_id",
/// "revoked_at"
/// ],
/// "properties": {
/// "connection_type": {
/// "type": "string"
/// },
/// "environment": {
/// "type": "string"
/// },
/// "event_access_id": {
/// "type": "string"
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "organization_id": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "project_id": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "revoked_at": {
/// "type": "string",
/// "format": "date-time"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ApiKeyRevokedPayload {
pub connection_type: ::std::string::String,
pub environment: ::std::string::String,
pub event_access_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub project_id: ::std::option::Option<::uuid::Uuid>,
pub revoked_at: ::chrono::DateTime<::chrono::offset::Utc>,
}
///`ChangeLog`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct ChangeLog(
pub ::serde_json::Map<::std::string::String, ::serde_json::Value>,
);
impl ::std::ops::Deref for ChangeLog {
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<ChangeLog>
for ::serde_json::Map<::std::string::String, ::serde_json::Value> {
fn from(value: ChangeLog) -> Self {
value.0
}
}
impl ::std::convert::From<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
> for ChangeLog {
fn from(
value: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
) -> Self {
Self(value)
}
}
/**The access a grant confers on one connection, surfaced to the MCP client so
the agent knows what it can run without probing. Derived from the grant's
[`AccessRules`]: no rule (or an unrestricted one) is [`ConnectionAccess::Full`],
a method-scoped rule is [`ConnectionAccess::Methods`], and an action-scoped
rule is [`ConnectionAccess::Actions`] with each id resolved to its title and
access level.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The access a grant confers on one connection, surfaced to the MCP client so\nthe agent knows what it can run without probing. Derived from the grant's\n[`AccessRules`]: no rule (or an unrestricted one) is [`ConnectionAccess::Full`],\na method-scoped rule is [`ConnectionAccess::Methods`], and an action-scoped\nrule is [`ConnectionAccess::Actions`] with each id resolved to its title and\naccess level.",
/// "oneOf": [
/// {
/// "description": "Every action on the connection.",
/// "type": "object",
/// "required": [
/// "policy"
/// ],
/// "properties": {
/// "policy": {
/// "type": "string",
/// "enum": [
/// "full"
/// ]
/// }
/// }
/// },
/// {
/// "description": "Only actions at the levels `methods` stand for, reported in `access`.",
/// "type": "object",
/// "required": [
/// "access",
/// "methods",
/// "policy"
/// ],
/// "properties": {
/// "access": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/ActionAccess"
/// }
/// },
/// "methods": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/Method"
/// }
/// },
/// "policy": {
/// "type": "string",
/// "enum": [
/// "methods"
/// ]
/// }
/// }
/// },
/// {
/// "description": "Only these specific actions.",
/// "type": "object",
/// "required": [
/// "actions",
/// "policy"
/// ],
/// "properties": {
/// "actions": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/GrantedAction"
/// }
/// },
/// "policy": {
/// "type": "string",
/// "enum": [
/// "actions"
/// ]
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(tag = "policy")]
pub enum ConnectionAccess {
#[serde(rename = "full")]
Full,
///Only actions at the levels `methods` stand for, reported in `access`.
#[serde(rename = "methods")]
Methods {
access: ::std::vec::Vec<ActionAccess>,
methods: ::std::vec::Vec<Method>,
},
///Only these specific actions.
#[serde(rename = "actions")]
Actions { actions: ::std::vec::Vec<GrantedAction> },
}
///`ConnectionCreatedPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "connection_id",
/// "connection_type",
/// "created_at",
/// "environment",
/// "key",
/// "platform",
/// "state"
/// ],
/// "properties": {
/// "connection_id": {
/// "type": "string",
/// "format": "uuid"
/// },
/// "connection_type": {
/// "type": "string"
/// },
/// "created_at": {
/// "type": "string",
/// "format": "date-time"
/// },
/// "environment": {
/// "type": "string"
/// },
/// "key": {
/// "type": "string"
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "organization_id": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "platform": {
/// "type": "string"
/// },
/// "project_id": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "state": {
/// "type": "string"
/// }
/// },
/// "x-one-connection-scoped": true
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ConnectionCreatedPayload {
pub connection_id: ::uuid::Uuid,
pub connection_type: ::std::string::String,
pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
pub environment: ::std::string::String,
pub key: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub organization_id: ::std::option::Option<::uuid::Uuid>,
pub platform: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub project_id: ::std::option::Option<::uuid::Uuid>,
pub state: ::std::string::String,
}
///`ConnectionDeletedPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "connection_id",
/// "deleted_at",
/// "platform"
/// ],
/// "properties": {
/// "connection_id": {
/// "type": "string",
/// "format": "uuid"
/// },
/// "deleted_at": {
/// "type": "string",
/// "format": "date-time"
/// },
/// "key": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "organization_id": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "platform": {
/// "type": "string"
/// },
/// "project_id": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// }
/// },
/// "x-one-connection-scoped": true
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ConnectionDeletedPayload {
pub connection_id: ::uuid::Uuid,
pub deleted_at: ::chrono::DateTime<::chrono::offset::Utc>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub key: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub organization_id: ::std::option::Option<::uuid::Uuid>,
pub platform: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub project_id: ::std::option::Option<::uuid::Uuid>,
}
///`ConnectionIdentityType`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "organization",
/// "user",
/// "team",
/// "project"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum ConnectionIdentityType {
#[serde(rename = "organization")]
Organization,
#[serde(rename = "user")]
User,
#[serde(rename = "team")]
Team,
#[serde(rename = "project")]
Project,
}
impl ::std::fmt::Display for ConnectionIdentityType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Organization => f.write_str("organization"),
Self::User => f.write_str("user"),
Self::Team => f.write_str("team"),
Self::Project => f.write_str("project"),
}
}
}
impl ::std::str::FromStr for ConnectionIdentityType {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"organization" => Ok(Self::Organization),
"user" => Ok(Self::User),
"team" => Ok(Self::Team),
"project" => Ok(Self::Project),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ConnectionIdentityType {
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 ConnectionIdentityType {
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 ConnectionIdentityType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`ConnectionOAuthCreatedPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "authorized_at",
/// "connection_id",
/// "key",
/// "platform",
/// "user_id"
/// ],
/// "properties": {
/// "authorized_at": {
/// "type": "string",
/// "format": "date-time"
/// },
/// "connection_id": {
/// "type": "string",
/// "format": "uuid"
/// },
/// "key": {
/// "type": "string"
/// },
/// "platform": {
/// "type": "string"
/// },
/// "user_id": {
/// "type": "string",
/// "format": "uuid"
/// }
/// },
/// "x-one-connection-scoped": true
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ConnectionOAuthCreatedPayload {
pub authorized_at: ::chrono::DateTime<::chrono::offset::Utc>,
pub connection_id: ::uuid::Uuid,
pub key: ::std::string::String,
pub platform: ::std::string::String,
pub user_id: ::uuid::Uuid,
}
/**Who reaches a connection: every member of its tenant (`tenant`), the
member who added it and the people it is shared with (`shared`), or the
member who added it alone (`own`).*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Who reaches a connection: every member of its tenant (`tenant`), the\nmember who added it and the people it is shared with (`shared`), or the\nmember who added it alone (`own`).",
/// "type": "string",
/// "enum": [
/// "tenant",
/// "shared",
/// "own"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum ConnectionSharing {
#[serde(rename = "tenant")]
Tenant,
#[serde(rename = "shared")]
Shared,
#[serde(rename = "own")]
Own,
}
impl ::std::fmt::Display for ConnectionSharing {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Tenant => f.write_str("tenant"),
Self::Shared => f.write_str("shared"),
Self::Own => f.write_str("own"),
}
}
}
impl ::std::str::FromStr for ConnectionSharing {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"tenant" => Ok(Self::Tenant),
"shared" => Ok(Self::Shared),
"own" => Ok(Self::Own),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ConnectionSharing {
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 ConnectionSharing {
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 ConnectionSharing {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`ConnectionStateType`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "operational",
/// "degraded",
/// "failed",
/// "unknown"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum ConnectionStateType {
#[serde(rename = "operational")]
Operational,
#[serde(rename = "degraded")]
Degraded,
#[serde(rename = "failed")]
Failed,
#[serde(rename = "unknown")]
Unknown,
}
impl ::std::fmt::Display for ConnectionStateType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Operational => f.write_str("operational"),
Self::Degraded => f.write_str("degraded"),
Self::Failed => f.write_str("failed"),
Self::Unknown => f.write_str("unknown"),
}
}
}
impl ::std::str::FromStr for ConnectionStateType {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"operational" => Ok(Self::Operational),
"degraded" => Ok(Self::Degraded),
"failed" => Ok(Self::Failed),
"unknown" => Ok(Self::Unknown),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ConnectionStateType {
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 ConnectionStateType {
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 ConnectionStateType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`ConnectionType`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "api",
/// "databasesql",
/// "databasenosql",
/// "filesystem",
/// "stream",
/// "custom"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum ConnectionType {
#[serde(rename = "api")]
Api,
#[serde(rename = "databasesql")]
Databasesql,
#[serde(rename = "databasenosql")]
Databasenosql,
#[serde(rename = "filesystem")]
Filesystem,
#[serde(rename = "stream")]
Stream,
#[serde(rename = "custom")]
Custom,
}
impl ::std::fmt::Display for ConnectionType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Api => f.write_str("api"),
Self::Databasesql => f.write_str("databasesql"),
Self::Databasenosql => f.write_str("databasenosql"),
Self::Filesystem => f.write_str("filesystem"),
Self::Stream => f.write_str("stream"),
Self::Custom => f.write_str("custom"),
}
}
}
impl ::std::str::FromStr for ConnectionType {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"api" => Ok(Self::Api),
"databasesql" => Ok(Self::Databasesql),
"databasenosql" => Ok(Self::Databasenosql),
"filesystem" => Ok(Self::Filesystem),
"stream" => Ok(Self::Stream),
"custom" => Ok(Self::Custom),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ConnectionType {
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 ConnectionType {
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 ConnectionType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
/**Carries the connection's state after the change, so a subscriber can apply
it without refetching.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Carries the connection's state after the change, so a subscriber can apply\nit without refetching.",
/// "type": "object",
/// "required": [
/// "connection_id",
/// "key",
/// "platform",
/// "tags",
/// "updated_at"
/// ],
/// "properties": {
/// "connection_id": {
/// "type": "string",
/// "format": "uuid"
/// },
/// "key": {
/// "type": "string"
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "organization_id": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "platform": {
/// "type": "string"
/// },
/// "project_id": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "tags": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "updated_at": {
/// "type": "string",
/// "format": "date-time"
/// }
/// },
/// "x-one-connection-scoped": true
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ConnectionUpdatedPayload {
pub connection_id: ::uuid::Uuid,
pub key: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub organization_id: ::std::option::Option<::uuid::Uuid>,
pub platform: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub project_id: ::std::option::Option<::uuid::Uuid>,
pub tags: ::std::vec::Vec<::std::string::String>,
pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
}
///`ErrorResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "correlationId",
/// "key",
/// "message",
/// "status",
/// "type"
/// ],
/// "properties": {
/// "correlationId": {
/// "examples": [
/// "550e8400-e29b-41d4-a716-446655440000"
/// ],
/// "type": "string"
/// },
/// "key": {
/// "examples": [
/// "http_error"
/// ],
/// "type": "string"
/// },
/// "message": {
/// "examples": [
/// "Authentication required"
/// ],
/// "type": "string"
/// },
/// "status": {
/// "examples": [
/// 401
/// ],
/// "type": "integer",
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "type": {
/// "examples": [
/// "http_error"
/// ],
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ErrorResponse {
#[serde(rename = "correlationId")]
pub correlation_id: ::std::string::String,
pub key: ::std::string::String,
pub message: ::std::string::String,
pub status: i32,
#[serde(rename = "type")]
pub type_: ::std::string::String,
}
///`GrantCreatedPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "allOf": [
/// {
/// "description": "A grant's identity, carried by every event in the family.\n\n**The connected user is named by `connect_user_id`, never by their One user\nid.** That opaque id is the only identifier the application has ever seen -\nthe token exchange hands it one and it stores it on its own user row - so it\nis the only one a delivery can be joined on. The platform user id would also\nname a person across every application that holds a grant for them, which is\nprecisely what the opaque id exists to prevent.\n\n**No reach, deliberately.** What the grant now reaches is\n`GET /v1/connections/reachable`, which has its own authorization and answers\nthe current set; a copy inlined here would be stale the moment it is read\nand would put one user's connection keys in a delivery the application may\nlog. `version` is what the application compares to know its copy is behind.",
/// "type": "object",
/// "required": [
/// "client_id",
/// "connect_user_id",
/// "environment",
/// "grant_id",
/// "version"
/// ],
/// "properties": {
/// "client_id": {
/// "description": "The public `client_id` the application knows itself by, not the integer\nkey.",
/// "type": "string"
/// },
/// "connect_user_id": {
/// "type": "string"
/// },
/// "environment": {
/// "type": "string",
/// "enum": [
/// "test",
/// "live"
/// ]
/// },
/// "grant_id": {
/// "type": "string"
/// },
/// "version": {
/// "description": "Which revision of this grant's reach the delivery describes. Bumped by\nevery consent and every edit, so an application can tell a change it\nhas already applied from one it has not.\n\nTwo things it is not. It counts within one grant rather than across a\nuser, so a grant created after a revocation starts at 1 again and the\ncomparison has to be keyed by `grant_id`. And `grant.revoked` repeats\nthe version the grant last reached rather than taking a new one,\nbecause revoking changes who may act and not what the grant describes -\nso it is the one event in the family that must not be discarded as\nalready-seen. Deduplicate on `X-Webhook-Event-Id`, never on this.",
/// "type": "integer",
/// "format": "int64"
/// }
/// }
/// },
/// {
/// "type": "object",
/// "required": [
/// "consent_surface",
/// "created_at"
/// ],
/// "properties": {
/// "consent_surface": {
/// "description": "Where the user answered: the page One renders, or the connect card\nframed inside the application's own site.",
/// "oneOf": [
/// {
/// "description": "Where an OAuth client's users are sent to grant consent.\n\nThe surface used to be read off the client id, so a client could only get a\ndifferent one by being renamed, and every existing client would have moved\nthe moment the rule changed. Naming it on the row makes it a property of the\nclient that its owner can see and set, and leaves the ones already running\nexactly where they are.",
/// "type": "string",
/// "enum": [
/// "hosted",
/// "connect"
/// ]
/// }
/// ]
/// },
/// "created_at": {
/// "type": "string",
/// "format": "date-time"
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GrantCreatedPayload {
/**The public `client_id` the application knows itself by, not the integer
key.*/
pub client_id: ::std::string::String,
pub connect_user_id: ::std::string::String,
/**Where the user answered: the page One renders, or the connect card
framed inside the application's own site.*/
pub consent_surface: GrantCreatedPayloadConsentSurface,
pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
pub environment: GrantCreatedPayloadEnvironment,
pub grant_id: ::std::string::String,
/**Which revision of this grant's reach the delivery describes. Bumped by
every consent and every edit, so an application can tell a change it
has already applied from one it has not.
Two things it is not. It counts within one grant rather than across a
user, so a grant created after a revocation starts at 1 again and the
comparison has to be keyed by `grant_id`. And `grant.revoked` repeats
the version the grant last reached rather than taking a new one,
because revoking changes who may act and not what the grant describes -
so it is the one event in the family that must not be discarded as
already-seen. Deduplicate on `X-Webhook-Event-Id`, never on this.*/
pub version: i64,
}
/**Where the user answered: the page One renders, or the connect card
framed inside the application's own site.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Where the user answered: the page One renders, or the connect card\nframed inside the application's own site.",
/// "oneOf": [
/// {
/// "description": "Where an OAuth client's users are sent to grant consent.\n\nThe surface used to be read off the client id, so a client could only get a\ndifferent one by being renamed, and every existing client would have moved\nthe moment the rule changed. Naming it on the row makes it a property of the\nclient that its owner can see and set, and leaves the ones already running\nexactly where they are.",
/// "type": "string",
/// "enum": [
/// "hosted",
/// "connect"
/// ]
/// }
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum GrantCreatedPayloadConsentSurface {
/**Where an OAuth client's users are sent to grant consent.
The surface used to be read off the client id, so a client could only get a
different one by being renamed, and every existing client would have moved
the moment the rule changed. Naming it on the row makes it a property of the
client that its owner can see and set, and leaves the ones already running
exactly where they are.*/
#[serde(rename = "hosted")]
Hosted,
/**Where an OAuth client's users are sent to grant consent.
The surface used to be read off the client id, so a client could only get a
different one by being renamed, and every existing client would have moved
the moment the rule changed. Naming it on the row makes it a property of the
client that its owner can see and set, and leaves the ones already running
exactly where they are.*/
#[serde(rename = "connect")]
Connect,
}
impl ::std::fmt::Display for GrantCreatedPayloadConsentSurface {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Hosted => f.write_str("hosted"),
Self::Connect => f.write_str("connect"),
}
}
}
impl ::std::str::FromStr for GrantCreatedPayloadConsentSurface {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"hosted" => Ok(Self::Hosted),
"connect" => Ok(Self::Connect),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for GrantCreatedPayloadConsentSurface {
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 GrantCreatedPayloadConsentSurface {
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 GrantCreatedPayloadConsentSurface {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`GrantCreatedPayloadEnvironment`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "test",
/// "live"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum GrantCreatedPayloadEnvironment {
#[serde(rename = "test")]
Test,
#[serde(rename = "live")]
Live,
}
impl ::std::fmt::Display for GrantCreatedPayloadEnvironment {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Test => f.write_str("test"),
Self::Live => f.write_str("live"),
}
}
}
impl ::std::str::FromStr for GrantCreatedPayloadEnvironment {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"test" => Ok(Self::Test),
"live" => Ok(Self::Live),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for GrantCreatedPayloadEnvironment {
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 GrantCreatedPayloadEnvironment {
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 GrantCreatedPayloadEnvironment {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`GrantRevokedPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "allOf": [
/// {
/// "description": "A grant's identity, carried by every event in the family.\n\n**The connected user is named by `connect_user_id`, never by their One user\nid.** That opaque id is the only identifier the application has ever seen -\nthe token exchange hands it one and it stores it on its own user row - so it\nis the only one a delivery can be joined on. The platform user id would also\nname a person across every application that holds a grant for them, which is\nprecisely what the opaque id exists to prevent.\n\n**No reach, deliberately.** What the grant now reaches is\n`GET /v1/connections/reachable`, which has its own authorization and answers\nthe current set; a copy inlined here would be stale the moment it is read\nand would put one user's connection keys in a delivery the application may\nlog. `version` is what the application compares to know its copy is behind.",
/// "type": "object",
/// "required": [
/// "client_id",
/// "connect_user_id",
/// "environment",
/// "grant_id",
/// "version"
/// ],
/// "properties": {
/// "client_id": {
/// "description": "The public `client_id` the application knows itself by, not the integer\nkey.",
/// "type": "string"
/// },
/// "connect_user_id": {
/// "type": "string"
/// },
/// "environment": {
/// "type": "string",
/// "enum": [
/// "test",
/// "live"
/// ]
/// },
/// "grant_id": {
/// "type": "string"
/// },
/// "version": {
/// "description": "Which revision of this grant's reach the delivery describes. Bumped by\nevery consent and every edit, so an application can tell a change it\nhas already applied from one it has not.\n\nTwo things it is not. It counts within one grant rather than across a\nuser, so a grant created after a revocation starts at 1 again and the\ncomparison has to be keyed by `grant_id`. And `grant.revoked` repeats\nthe version the grant last reached rather than taking a new one,\nbecause revoking changes who may act and not what the grant describes -\nso it is the one event in the family that must not be discarded as\nalready-seen. Deduplicate on `X-Webhook-Event-Id`, never on this.",
/// "type": "integer",
/// "format": "int64"
/// }
/// }
/// },
/// {
/// "type": "object",
/// "required": [
/// "revoked_at",
/// "revoked_by"
/// ],
/// "properties": {
/// "reason": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "revoked_at": {
/// "type": "string",
/// "format": "date-time"
/// },
/// "revoked_by": {
/// "description": "Who ended a grant, which decides how the application answers: after the\nuser or a departure it may prompt the user to reconnect, and after the\napplication's owner or a tenant admin ended it deliberately it does not.\nOne field rather than one event per actor.",
/// "type": "string",
/// "enum": [
/// "user",
/// "developer",
/// "departure",
/// "admin"
/// ]
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GrantRevokedPayload {
/**The public `client_id` the application knows itself by, not the integer
key.*/
pub client_id: ::std::string::String,
pub connect_user_id: ::std::string::String,
pub environment: GrantRevokedPayloadEnvironment,
pub grant_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub reason: ::std::option::Option<::std::string::String>,
pub revoked_at: ::chrono::DateTime<::chrono::offset::Utc>,
/**Who ended a grant, which decides how the application answers: after the
user or a departure it may prompt the user to reconnect, and after the
application's owner or a tenant admin ended it deliberately it does not.
One field rather than one event per actor.*/
pub revoked_by: GrantRevokedPayloadRevokedBy,
/**Which revision of this grant's reach the delivery describes. Bumped by
every consent and every edit, so an application can tell a change it
has already applied from one it has not.
Two things it is not. It counts within one grant rather than across a
user, so a grant created after a revocation starts at 1 again and the
comparison has to be keyed by `grant_id`. And `grant.revoked` repeats
the version the grant last reached rather than taking a new one,
because revoking changes who may act and not what the grant describes -
so it is the one event in the family that must not be discarded as
already-seen. Deduplicate on `X-Webhook-Event-Id`, never on this.*/
pub version: i64,
}
///`GrantRevokedPayloadEnvironment`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "test",
/// "live"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum GrantRevokedPayloadEnvironment {
#[serde(rename = "test")]
Test,
#[serde(rename = "live")]
Live,
}
impl ::std::fmt::Display for GrantRevokedPayloadEnvironment {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Test => f.write_str("test"),
Self::Live => f.write_str("live"),
}
}
}
impl ::std::str::FromStr for GrantRevokedPayloadEnvironment {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"test" => Ok(Self::Test),
"live" => Ok(Self::Live),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for GrantRevokedPayloadEnvironment {
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 GrantRevokedPayloadEnvironment {
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 GrantRevokedPayloadEnvironment {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
/**Who ended a grant, which decides how the application answers: after the
user or a departure it may prompt the user to reconnect, and after the
application's owner or a tenant admin ended it deliberately it does not.
One field rather than one event per actor.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Who ended a grant, which decides how the application answers: after the\nuser or a departure it may prompt the user to reconnect, and after the\napplication's owner or a tenant admin ended it deliberately it does not.\nOne field rather than one event per actor.",
/// "type": "string",
/// "enum": [
/// "user",
/// "developer",
/// "departure",
/// "admin"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum GrantRevokedPayloadRevokedBy {
#[serde(rename = "user")]
User,
#[serde(rename = "developer")]
Developer,
#[serde(rename = "departure")]
Departure,
#[serde(rename = "admin")]
Admin,
}
impl ::std::fmt::Display for GrantRevokedPayloadRevokedBy {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::User => f.write_str("user"),
Self::Developer => f.write_str("developer"),
Self::Departure => f.write_str("departure"),
Self::Admin => f.write_str("admin"),
}
}
}
impl ::std::str::FromStr for GrantRevokedPayloadRevokedBy {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"user" => Ok(Self::User),
"developer" => Ok(Self::Developer),
"departure" => Ok(Self::Departure),
"admin" => Ok(Self::Admin),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for GrantRevokedPayloadRevokedBy {
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 GrantRevokedPayloadRevokedBy {
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 GrantRevokedPayloadRevokedBy {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`GrantUpdatedPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "allOf": [
/// {
/// "description": "A grant's identity, carried by every event in the family.\n\n**The connected user is named by `connect_user_id`, never by their One user\nid.** That opaque id is the only identifier the application has ever seen -\nthe token exchange hands it one and it stores it on its own user row - so it\nis the only one a delivery can be joined on. The platform user id would also\nname a person across every application that holds a grant for them, which is\nprecisely what the opaque id exists to prevent.\n\n**No reach, deliberately.** What the grant now reaches is\n`GET /v1/connections/reachable`, which has its own authorization and answers\nthe current set; a copy inlined here would be stale the moment it is read\nand would put one user's connection keys in a delivery the application may\nlog. `version` is what the application compares to know its copy is behind.",
/// "type": "object",
/// "required": [
/// "client_id",
/// "connect_user_id",
/// "environment",
/// "grant_id",
/// "version"
/// ],
/// "properties": {
/// "client_id": {
/// "description": "The public `client_id` the application knows itself by, not the integer\nkey.",
/// "type": "string"
/// },
/// "connect_user_id": {
/// "type": "string"
/// },
/// "environment": {
/// "type": "string",
/// "enum": [
/// "test",
/// "live"
/// ]
/// },
/// "grant_id": {
/// "type": "string"
/// },
/// "version": {
/// "description": "Which revision of this grant's reach the delivery describes. Bumped by\nevery consent and every edit, so an application can tell a change it\nhas already applied from one it has not.\n\nTwo things it is not. It counts within one grant rather than across a\nuser, so a grant created after a revocation starts at 1 again and the\ncomparison has to be keyed by `grant_id`. And `grant.revoked` repeats\nthe version the grant last reached rather than taking a new one,\nbecause revoking changes who may act and not what the grant describes -\nso it is the one event in the family that must not be discarded as\nalready-seen. Deduplicate on `X-Webhook-Event-Id`, never on this.",
/// "type": "integer",
/// "format": "int64"
/// }
/// }
/// },
/// {
/// "type": "object",
/// "required": [
/// "source",
/// "updated_at"
/// ],
/// "properties": {
/// "source": {
/// "description": "What moved a live grant.\n\nOne field on `grant.updated` rather than two events: an application can\nprompt the user to re-consent and cannot prompt them to un-edit, so it\nbranches on this, but it is one occurrence either way.",
/// "type": "string",
/// "enum": [
/// "consent",
/// "user_edit"
/// ]
/// },
/// "updated_at": {
/// "type": "string",
/// "format": "date-time"
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GrantUpdatedPayload {
/**The public `client_id` the application knows itself by, not the integer
key.*/
pub client_id: ::std::string::String,
pub connect_user_id: ::std::string::String,
pub environment: GrantUpdatedPayloadEnvironment,
pub grant_id: ::std::string::String,
/**What moved a live grant.
One field on `grant.updated` rather than two events: an application can
prompt the user to re-consent and cannot prompt them to un-edit, so it
branches on this, but it is one occurrence either way.*/
pub source: GrantUpdatedPayloadSource,
pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
/**Which revision of this grant's reach the delivery describes. Bumped by
every consent and every edit, so an application can tell a change it
has already applied from one it has not.
Two things it is not. It counts within one grant rather than across a
user, so a grant created after a revocation starts at 1 again and the
comparison has to be keyed by `grant_id`. And `grant.revoked` repeats
the version the grant last reached rather than taking a new one,
because revoking changes who may act and not what the grant describes -
so it is the one event in the family that must not be discarded as
already-seen. Deduplicate on `X-Webhook-Event-Id`, never on this.*/
pub version: i64,
}
///`GrantUpdatedPayloadEnvironment`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "test",
/// "live"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum GrantUpdatedPayloadEnvironment {
#[serde(rename = "test")]
Test,
#[serde(rename = "live")]
Live,
}
impl ::std::fmt::Display for GrantUpdatedPayloadEnvironment {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Test => f.write_str("test"),
Self::Live => f.write_str("live"),
}
}
}
impl ::std::str::FromStr for GrantUpdatedPayloadEnvironment {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"test" => Ok(Self::Test),
"live" => Ok(Self::Live),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for GrantUpdatedPayloadEnvironment {
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 GrantUpdatedPayloadEnvironment {
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 GrantUpdatedPayloadEnvironment {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
/**What moved a live grant.
One field on `grant.updated` rather than two events: an application can
prompt the user to re-consent and cannot prompt them to un-edit, so it
branches on this, but it is one occurrence either way.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "What moved a live grant.\n\nOne field on `grant.updated` rather than two events: an application can\nprompt the user to re-consent and cannot prompt them to un-edit, so it\nbranches on this, but it is one occurrence either way.",
/// "type": "string",
/// "enum": [
/// "consent",
/// "user_edit"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum GrantUpdatedPayloadSource {
#[serde(rename = "consent")]
Consent,
#[serde(rename = "user_edit")]
UserEdit,
}
impl ::std::fmt::Display for GrantUpdatedPayloadSource {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Consent => f.write_str("consent"),
Self::UserEdit => f.write_str("user_edit"),
}
}
}
impl ::std::str::FromStr for GrantUpdatedPayloadSource {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"consent" => Ok(Self::Consent),
"user_edit" => Ok(Self::UserEdit),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for GrantUpdatedPayloadSource {
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 GrantUpdatedPayloadSource {
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 GrantUpdatedPayloadSource {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///One action a grant permits on a connection, resolved from an action id.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "One action a grant permits on a connection, resolved from an action id.",
/// "type": "object",
/// "required": [
/// "access",
/// "actionId",
/// "method",
/// "title"
/// ],
/// "properties": {
/// "access": {
/// "$ref": "#/components/schemas/ActionAccess"
/// },
/// "actionId": {
/// "type": "string"
/// },
/// "method": {
/// "$ref": "#/components/schemas/Method"
/// },
/// "title": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GrantedAction {
pub access: ActionAccess,
#[serde(rename = "actionId")]
pub action_id: ::std::string::String,
pub method: Method,
pub title: ::std::string::String,
}
///`MemberAddedPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "added_at",
/// "email",
/// "user_id"
/// ],
/// "properties": {
/// "added_at": {
/// "type": "string",
/// "format": "date-time"
/// },
/// "email": {
/// "type": "string"
/// },
/// "organization_id": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "organization_name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "project_id": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "project_name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "user_id": {
/// "type": "string",
/// "format": "uuid"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MemberAddedPayload {
pub added_at: ::chrono::DateTime<::chrono::offset::Utc>,
pub email: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub organization_name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub project_id: ::std::option::Option<::uuid::Uuid>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub project_name: ::std::option::Option<::std::string::String>,
pub user_id: ::uuid::Uuid,
}
///`MemberRemovedPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "email",
/// "removed_at",
/// "user_id"
/// ],
/// "properties": {
/// "email": {
/// "type": "string"
/// },
/// "organization_id": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "organization_name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "project_id": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "project_name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "removed_at": {
/// "type": "string",
/// "format": "date-time"
/// },
/// "user_id": {
/// "type": "string",
/// "format": "uuid"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MemberRemovedPayload {
pub email: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub organization_name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub project_id: ::std::option::Option<::uuid::Uuid>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub project_name: ::std::option::Option<::std::string::String>,
pub removed_at: ::chrono::DateTime<::chrono::offset::Utc>,
pub user_id: ::uuid::Uuid,
}
///`MemberRoleUpdatedPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "email",
/// "new_role",
/// "old_role",
/// "updated_at",
/// "user_id"
/// ],
/// "properties": {
/// "email": {
/// "type": "string"
/// },
/// "new_role": {
/// "type": "string"
/// },
/// "old_role": {
/// "type": "string"
/// },
/// "organization_id": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "organization_name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "project_id": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "project_name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "updated_at": {
/// "type": "string",
/// "format": "date-time"
/// },
/// "user_id": {
/// "type": "string",
/// "format": "uuid"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MemberRoleUpdatedPayload {
pub email: ::std::string::String,
pub new_role: ::std::string::String,
pub old_role: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub organization_name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub project_id: ::std::option::Option<::uuid::Uuid>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub project_name: ::std::option::Option<::std::string::String>,
pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
pub user_id: ::uuid::Uuid,
}
///`Method`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "OPTIONS",
/// "GET",
/// "POST",
/// "PUT",
/// "DELETE",
/// "HEAD",
/// "TRACE",
/// "CONNECT",
/// "PATCH"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum Method {
#[serde(rename = "OPTIONS")]
Options,
#[serde(rename = "GET")]
Get,
#[serde(rename = "POST")]
Post,
#[serde(rename = "PUT")]
Put,
#[serde(rename = "DELETE")]
Delete,
#[serde(rename = "HEAD")]
Head,
#[serde(rename = "TRACE")]
Trace,
#[serde(rename = "CONNECT")]
Connect,
#[serde(rename = "PATCH")]
Patch,
}
impl ::std::fmt::Display for Method {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Options => f.write_str("OPTIONS"),
Self::Get => f.write_str("GET"),
Self::Post => f.write_str("POST"),
Self::Put => f.write_str("PUT"),
Self::Delete => f.write_str("DELETE"),
Self::Head => f.write_str("HEAD"),
Self::Trace => f.write_str("TRACE"),
Self::Connect => f.write_str("CONNECT"),
Self::Patch => f.write_str("PATCH"),
}
}
}
impl ::std::str::FromStr for Method {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"OPTIONS" => Ok(Self::Options),
"GET" => Ok(Self::Get),
"POST" => Ok(Self::Post),
"PUT" => Ok(Self::Put),
"DELETE" => Ok(Self::Delete),
"HEAD" => Ok(Self::Head),
"TRACE" => Ok(Self::Trace),
"CONNECT" => Ok(Self::Connect),
"PATCH" => Ok(Self::Patch),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for Method {
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 Method {
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 Method {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`OAuthFailedPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "error",
/// "failed_at",
/// "platform"
/// ],
/// "properties": {
/// "connection_id": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "error": {
/// "type": "string"
/// },
/// "failed_at": {
/// "type": "string",
/// "format": "date-time"
/// },
/// "key": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "platform": {
/// "type": "string"
/// }
/// },
/// "x-one-connection-scoped": true
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OAuthFailedPayload {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub connection_id: ::std::option::Option<::uuid::Uuid>,
pub error: ::std::string::String,
pub failed_at: ::chrono::DateTime<::chrono::offset::Utc>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub key: ::std::option::Option<::std::string::String>,
pub platform: ::std::string::String,
}
///`OAuthRefreshedPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "connection_id",
/// "platform",
/// "refreshed_at"
/// ],
/// "properties": {
/// "connection_id": {
/// "type": "string",
/// "format": "uuid"
/// },
/// "key": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "platform": {
/// "type": "string"
/// },
/// "refreshed_at": {
/// "type": "string",
/// "format": "date-time"
/// }
/// },
/// "x-one-connection-scoped": true
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OAuthRefreshedPayload {
pub connection_id: ::uuid::Uuid,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub key: ::std::option::Option<::std::string::String>,
pub platform: ::std::string::String,
pub refreshed_at: ::chrono::DateTime<::chrono::offset::Utc>,
}
///`OrganizationCreatedPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "created_at",
/// "id",
/// "name"
/// ],
/// "properties": {
/// "created_at": {
/// "type": "string",
/// "format": "date-time"
/// },
/// "id": {
/// "type": "string",
/// "format": "uuid"
/// },
/// "name": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrganizationCreatedPayload {
pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
pub id: ::uuid::Uuid,
pub name: ::std::string::String,
}
///`OrganizationDeletedPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "deleted_at",
/// "id",
/// "name"
/// ],
/// "properties": {
/// "deleted_at": {
/// "type": "string",
/// "format": "date-time"
/// },
/// "id": {
/// "type": "string",
/// "format": "uuid"
/// },
/// "name": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrganizationDeletedPayload {
pub deleted_at: ::chrono::DateTime<::chrono::offset::Utc>,
pub id: ::uuid::Uuid,
pub name: ::std::string::String,
}
///`OrganizationUpdatedPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id",
/// "name",
/// "updated_at"
/// ],
/// "properties": {
/// "id": {
/// "type": "string",
/// "format": "uuid"
/// },
/// "name": {
/// "type": "string"
/// },
/// "updated_at": {
/// "type": "string",
/// "format": "date-time"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrganizationUpdatedPayload {
pub id: ::uuid::Uuid,
pub name: ::std::string::String,
pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
}
///`PaginatedReachableConnectionView`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "page",
/// "pages",
/// "rows",
/// "total"
/// ],
/// "properties": {
/// "page": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "pages": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "rows": {
/// "type": "array",
/// "items": {
/// "description": "A connection as a grant *reaches* it, for the grant-scoped reachable\nlisting.\n\nDeliberately narrow: the key a granted app connects with, the connector and\ndisplay it needs to render a tile, and the [`ConnectionAccess`] it may run,\nand nothing else. It carries no row id, `secret_id` or `user_id`, not even\nthe environment (the key already encodes it) or the active flag (only\nactive rows are listed). The account it acts as reaches the app only as the\nlabel, which RFC 0002 gives every connection so an app can tell two\naccounts of one platform apart. The management [`ConnectionView`] is\nuntouched.",
/// "type": "object",
/// "required": [
/// "access",
/// "connector",
/// "displayLabel",
/// "key",
/// "label",
/// "platform",
/// "sharing",
/// "viewerAccessLevel"
/// ],
/// "properties": {
/// "access": {
/// "$ref": "#/components/schemas/ConnectionAccess"
/// },
/// "connector": {
/// "type": "string"
/// },
/// "displayLabel": {
/// "description": "[`Self::label`] with whose it is.",
/// "type": "string"
/// },
/// "image": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "key": {
/// "type": "string"
/// },
/// "label": {
/// "description": "The app and the account the connection acts as ([`ConnectionLabel`]).",
/// "type": "string"
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "platform": {
/// "type": "string"
/// },
/// "sharing": {
/// "$ref": "#/components/schemas/ConnectionSharing"
/// },
/// "title": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "viewerAccessLevel": {
/// "$ref": "#/components/schemas/AccessLevel"
/// }
/// }
/// }
/// },
/// "total": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedReachableConnectionView {
pub page: i64,
pub pages: i64,
pub rows: ::std::vec::Vec<PaginatedReachableConnectionViewRowsItem>,
pub total: i64,
}
/**A connection as a grant *reaches* it, for the grant-scoped reachable
listing.
Deliberately narrow: the key a granted app connects with, the connector and
display it needs to render a tile, and the [`ConnectionAccess`] it may run,
and nothing else. It carries no row id, `secret_id` or `user_id`, not even
the environment (the key already encodes it) or the active flag (only
active rows are listed). The account it acts as reaches the app only as the
label, which RFC 0002 gives every connection so an app can tell two
accounts of one platform apart. The management [`ConnectionView`] is
untouched.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A connection as a grant *reaches* it, for the grant-scoped reachable\nlisting.\n\nDeliberately narrow: the key a granted app connects with, the connector and\ndisplay it needs to render a tile, and the [`ConnectionAccess`] it may run,\nand nothing else. It carries no row id, `secret_id` or `user_id`, not even\nthe environment (the key already encodes it) or the active flag (only\nactive rows are listed). The account it acts as reaches the app only as the\nlabel, which RFC 0002 gives every connection so an app can tell two\naccounts of one platform apart. The management [`ConnectionView`] is\nuntouched.",
/// "type": "object",
/// "required": [
/// "access",
/// "connector",
/// "displayLabel",
/// "key",
/// "label",
/// "platform",
/// "sharing",
/// "viewerAccessLevel"
/// ],
/// "properties": {
/// "access": {
/// "$ref": "#/components/schemas/ConnectionAccess"
/// },
/// "connector": {
/// "type": "string"
/// },
/// "displayLabel": {
/// "description": "[`Self::label`] with whose it is.",
/// "type": "string"
/// },
/// "image": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "key": {
/// "type": "string"
/// },
/// "label": {
/// "description": "The app and the account the connection acts as ([`ConnectionLabel`]).",
/// "type": "string"
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "platform": {
/// "type": "string"
/// },
/// "sharing": {
/// "$ref": "#/components/schemas/ConnectionSharing"
/// },
/// "title": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "viewerAccessLevel": {
/// "$ref": "#/components/schemas/AccessLevel"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedReachableConnectionViewRowsItem {
pub access: ConnectionAccess,
pub connector: ::std::string::String,
///[`Self::label`] with whose it is.
#[serde(rename = "displayLabel")]
pub display_label: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub image: ::std::option::Option<::std::string::String>,
pub key: ::std::string::String,
///The app and the account the connection acts as ([`ConnectionLabel`]).
pub label: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
pub platform: ::std::string::String,
pub sharing: ConnectionSharing,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub title: ::std::option::Option<::std::string::String>,
#[serde(rename = "viewerAccessLevel")]
pub viewer_access_level: AccessLevel,
}
///`PaginatedVaultConnectionView`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "page",
/// "pages",
/// "rows",
/// "total"
/// ],
/// "properties": {
/// "page": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "pages": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "rows": {
/// "type": "array",
/// "items": {
/// "type": "object",
/// "required": [
/// "active",
/// "addedBy",
/// "connector",
/// "description",
/// "displayLabel",
/// "environment",
/// "id",
/// "image",
/// "key",
/// "label",
/// "platform",
/// "platformVersion",
/// "sharing",
/// "state",
/// "tags",
/// "type",
/// "version"
/// ],
/// "properties": {
/// "active": {
/// "type": "boolean"
/// },
/// "addedBy": {
/// "description": "The member who added the connection.",
/// "type": "string",
/// "format": "uuid"
/// },
/// "connector": {
/// "description": "The connector behind this connection. Carried because a grant bounded\nby connectors decides on it, so a caller rendering what a token may do\nhere would otherwise have to resolve it by a second lookup per row.",
/// "type": "string"
/// },
/// "description": {
/// "type": "string"
/// },
/// "displayLabel": {
/// "description": "[`Self::label`] with whose it is.",
/// "type": "string"
/// },
/// "environment": {
/// "$ref": "#/components/schemas/SecretKeyEnvironment"
/// },
/// "id": {
/// "type": "string",
/// "format": "uuid"
/// },
/// "identity": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "identityType": {
/// "$ref": "#/components/schemas/ConnectionIdentityType"
/// },
/// "image": {
/// "type": "string"
/// },
/// "key": {
/// "type": "string"
/// },
/// "label": {
/// "description": "The app and the account the connection acts as ([`ConnectionLabel`]).",
/// "type": "string"
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "platform": {
/// "type": "string"
/// },
/// "platformVersion": {
/// "type": "string"
/// },
/// "sharing": {
/// "$ref": "#/components/schemas/ConnectionSharing"
/// },
/// "state": {
/// "$ref": "#/components/schemas/ConnectionStateType"
/// },
/// "tags": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "title": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "type": {
/// "$ref": "#/components/schemas/ConnectionType"
/// },
/// "version": {
/// "type": "string"
/// }
/// }
/// }
/// },
/// "total": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedVaultConnectionView {
pub page: i64,
pub pages: i64,
pub rows: ::std::vec::Vec<PaginatedVaultConnectionViewRowsItem>,
pub total: i64,
}
///`PaginatedVaultConnectionViewRowsItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "active",
/// "addedBy",
/// "connector",
/// "description",
/// "displayLabel",
/// "environment",
/// "id",
/// "image",
/// "key",
/// "label",
/// "platform",
/// "platformVersion",
/// "sharing",
/// "state",
/// "tags",
/// "type",
/// "version"
/// ],
/// "properties": {
/// "active": {
/// "type": "boolean"
/// },
/// "addedBy": {
/// "description": "The member who added the connection.",
/// "type": "string",
/// "format": "uuid"
/// },
/// "connector": {
/// "description": "The connector behind this connection. Carried because a grant bounded\nby connectors decides on it, so a caller rendering what a token may do\nhere would otherwise have to resolve it by a second lookup per row.",
/// "type": "string"
/// },
/// "description": {
/// "type": "string"
/// },
/// "displayLabel": {
/// "description": "[`Self::label`] with whose it is.",
/// "type": "string"
/// },
/// "environment": {
/// "$ref": "#/components/schemas/SecretKeyEnvironment"
/// },
/// "id": {
/// "type": "string",
/// "format": "uuid"
/// },
/// "identity": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "identityType": {
/// "$ref": "#/components/schemas/ConnectionIdentityType"
/// },
/// "image": {
/// "type": "string"
/// },
/// "key": {
/// "type": "string"
/// },
/// "label": {
/// "description": "The app and the account the connection acts as ([`ConnectionLabel`]).",
/// "type": "string"
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "platform": {
/// "type": "string"
/// },
/// "platformVersion": {
/// "type": "string"
/// },
/// "sharing": {
/// "$ref": "#/components/schemas/ConnectionSharing"
/// },
/// "state": {
/// "$ref": "#/components/schemas/ConnectionStateType"
/// },
/// "tags": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "title": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "type": {
/// "$ref": "#/components/schemas/ConnectionType"
/// },
/// "version": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedVaultConnectionViewRowsItem {
pub active: bool,
///The member who added the connection.
#[serde(rename = "addedBy")]
pub added_by: ::uuid::Uuid,
/**The connector behind this connection. Carried because a grant bounded
by connectors decides on it, so a caller rendering what a token may do
here would otherwise have to resolve it by a second lookup per row.*/
pub connector: ::std::string::String,
pub description: ::std::string::String,
///[`Self::label`] with whose it is.
#[serde(rename = "displayLabel")]
pub display_label: ::std::string::String,
pub environment: SecretKeyEnvironment,
pub id: ::uuid::Uuid,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub identity: ::std::option::Option<::std::string::String>,
#[serde(
rename = "identityType",
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub identity_type: ::std::option::Option<ConnectionIdentityType>,
pub image: ::std::string::String,
pub key: ::std::string::String,
///The app and the account the connection acts as ([`ConnectionLabel`]).
pub label: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
pub platform: ::std::string::String,
#[serde(rename = "platformVersion")]
pub platform_version: ::std::string::String,
pub sharing: ConnectionSharing,
pub state: ConnectionStateType,
pub tags: ::std::vec::Vec<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub title: ::std::option::Option<::std::string::String>,
#[serde(rename = "type")]
pub type_: ConnectionType,
pub version: ::std::string::String,
}
///`PassthroughExecutedPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "connection_id",
/// "duration_ms",
/// "method",
/// "path",
/// "platform",
/// "timestamp"
/// ],
/// "properties": {
/// "connection_id": {
/// "type": "string",
/// "format": "uuid"
/// },
/// "duration_ms": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "error": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "key": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "method": {
/// "type": "string"
/// },
/// "path": {
/// "type": "string"
/// },
/// "platform": {
/// "type": "string"
/// },
/// "status_code": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "timestamp": {
/// "type": "string",
/// "format": "date-time"
/// }
/// },
/// "x-one-connection-scoped": true
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PassthroughExecutedPayload {
pub connection_id: ::uuid::Uuid,
pub duration_ms: i64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub error: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub key: ::std::option::Option<::std::string::String>,
pub method: ::std::string::String,
pub path: ::std::string::String,
pub platform: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub status_code: ::std::option::Option<i32>,
pub timestamp: ::chrono::DateTime<::chrono::offset::Utc>,
}
///`ProjectCreatedPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "created_at",
/// "id",
/// "name",
/// "organization_id"
/// ],
/// "properties": {
/// "created_at": {
/// "type": "string",
/// "format": "date-time"
/// },
/// "id": {
/// "type": "string",
/// "format": "uuid"
/// },
/// "name": {
/// "type": "string"
/// },
/// "organization_id": {
/// "type": "string",
/// "format": "uuid"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ProjectCreatedPayload {
pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
pub id: ::uuid::Uuid,
pub name: ::std::string::String,
pub organization_id: ::uuid::Uuid,
}
///`ProjectDeletedPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "deleted_at",
/// "id",
/// "name",
/// "organization_id"
/// ],
/// "properties": {
/// "deleted_at": {
/// "type": "string",
/// "format": "date-time"
/// },
/// "id": {
/// "type": "string",
/// "format": "uuid"
/// },
/// "name": {
/// "type": "string"
/// },
/// "organization_id": {
/// "type": "string",
/// "format": "uuid"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ProjectDeletedPayload {
pub deleted_at: ::chrono::DateTime<::chrono::offset::Utc>,
pub id: ::uuid::Uuid,
pub name: ::std::string::String,
pub organization_id: ::uuid::Uuid,
}
///`ProjectUpdatedPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id",
/// "name",
/// "organization_id",
/// "updated_at"
/// ],
/// "properties": {
/// "id": {
/// "type": "string",
/// "format": "uuid"
/// },
/// "name": {
/// "type": "string"
/// },
/// "organization_id": {
/// "type": "string",
/// "format": "uuid"
/// },
/// "updated_at": {
/// "type": "string",
/// "format": "date-time"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ProjectUpdatedPayload {
pub id: ::uuid::Uuid,
pub name: ::std::string::String,
pub organization_id: ::uuid::Uuid,
pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
}
///`SecretKeyEnvironment`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "test",
/// "live"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum SecretKeyEnvironment {
#[serde(rename = "test")]
Test,
#[serde(rename = "live")]
Live,
}
impl ::std::fmt::Display for SecretKeyEnvironment {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Test => f.write_str("test"),
Self::Live => f.write_str("live"),
}
}
}
impl ::std::str::FromStr for SecretKeyEnvironment {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"test" => Ok(Self::Test),
"live" => Ok(Self::Live),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for SecretKeyEnvironment {
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 SecretKeyEnvironment {
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 SecretKeyEnvironment {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
/**Body of the idempotent upsert. `secret` is required, unlike on create: the
delivery path only signs when a subscription has one, so a secretless
listener would receive bodies a client cannot verify.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Body of the idempotent upsert. `secret` is required, unlike on create: the\ndelivery path only signs when a subscription has one, so a secretless\nlistener would receive bodies a client cannot verify.",
/// "type": "object",
/// "required": [
/// "events",
/// "secret",
/// "url"
/// ],
/// "properties": {
/// "active": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "description": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "events": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/WebhookEventType"
/// }
/// },
/// "metadata": {
/// "$ref": "#/components/schemas/Value"
/// },
/// "secret": {
/// "type": "string"
/// },
/// "url": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UpsertSubscriptionParams {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub active: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
pub events: ::std::vec::Vec<WebhookEventType>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub metadata: ::std::option::Option<Value>,
pub secret: ::std::string::String,
pub url: ::std::string::String,
}
///`Value`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct Value(pub ::serde_json::Value);
impl ::std::ops::Deref for Value {
type Target = ::serde_json::Value;
fn deref(&self) -> &::serde_json::Value {
&self.0
}
}
impl ::std::convert::From<Value> for ::serde_json::Value {
fn from(value: Value) -> Self {
value.0
}
}
impl ::std::convert::From<::serde_json::Value> for Value {
fn from(value: ::serde_json::Value) -> Self {
Self(value)
}
}
///Auto-generated discriminant enum variants
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Auto-generated discriminant enum variants",
/// "type": "string",
/// "enum": [
/// "connection.created",
/// "connection.oauth.created",
/// "connection.updated",
/// "connection.deleted",
/// "api_key.created",
/// "api_key.revoked",
/// "project.created",
/// "project.updated",
/// "project.deleted",
/// "organization.created",
/// "organization.updated",
/// "organization.deleted",
/// "oauth.refreshed",
/// "oauth.failed",
/// "passthrough.executed",
/// "member.added",
/// "member.removed",
/// "member.role_updated",
/// "grant.created",
/// "grant.updated",
/// "grant.revoked"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookEventType {
#[serde(rename = "connection.created")]
ConnectionCreated,
#[serde(rename = "connection.oauth.created")]
ConnectionOauthCreated,
#[serde(rename = "connection.updated")]
ConnectionUpdated,
#[serde(rename = "connection.deleted")]
ConnectionDeleted,
#[serde(rename = "api_key.created")]
ApiKeyCreated,
#[serde(rename = "api_key.revoked")]
ApiKeyRevoked,
#[serde(rename = "project.created")]
ProjectCreated,
#[serde(rename = "project.updated")]
ProjectUpdated,
#[serde(rename = "project.deleted")]
ProjectDeleted,
#[serde(rename = "organization.created")]
OrganizationCreated,
#[serde(rename = "organization.updated")]
OrganizationUpdated,
#[serde(rename = "organization.deleted")]
OrganizationDeleted,
#[serde(rename = "oauth.refreshed")]
OauthRefreshed,
#[serde(rename = "oauth.failed")]
OauthFailed,
#[serde(rename = "passthrough.executed")]
PassthroughExecuted,
#[serde(rename = "member.added")]
MemberAdded,
#[serde(rename = "member.removed")]
MemberRemoved,
#[serde(rename = "member.role_updated")]
MemberRoleUpdated,
#[serde(rename = "grant.created")]
GrantCreated,
#[serde(rename = "grant.updated")]
GrantUpdated,
#[serde(rename = "grant.revoked")]
GrantRevoked,
}
impl ::std::fmt::Display for WebhookEventType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::ConnectionCreated => f.write_str("connection.created"),
Self::ConnectionOauthCreated => f.write_str("connection.oauth.created"),
Self::ConnectionUpdated => f.write_str("connection.updated"),
Self::ConnectionDeleted => f.write_str("connection.deleted"),
Self::ApiKeyCreated => f.write_str("api_key.created"),
Self::ApiKeyRevoked => f.write_str("api_key.revoked"),
Self::ProjectCreated => f.write_str("project.created"),
Self::ProjectUpdated => f.write_str("project.updated"),
Self::ProjectDeleted => f.write_str("project.deleted"),
Self::OrganizationCreated => f.write_str("organization.created"),
Self::OrganizationUpdated => f.write_str("organization.updated"),
Self::OrganizationDeleted => f.write_str("organization.deleted"),
Self::OauthRefreshed => f.write_str("oauth.refreshed"),
Self::OauthFailed => f.write_str("oauth.failed"),
Self::PassthroughExecuted => f.write_str("passthrough.executed"),
Self::MemberAdded => f.write_str("member.added"),
Self::MemberRemoved => f.write_str("member.removed"),
Self::MemberRoleUpdated => f.write_str("member.role_updated"),
Self::GrantCreated => f.write_str("grant.created"),
Self::GrantUpdated => f.write_str("grant.updated"),
Self::GrantRevoked => f.write_str("grant.revoked"),
}
}
}
impl ::std::str::FromStr for WebhookEventType {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"connection.created" => Ok(Self::ConnectionCreated),
"connection.oauth.created" => Ok(Self::ConnectionOauthCreated),
"connection.updated" => Ok(Self::ConnectionUpdated),
"connection.deleted" => Ok(Self::ConnectionDeleted),
"api_key.created" => Ok(Self::ApiKeyCreated),
"api_key.revoked" => Ok(Self::ApiKeyRevoked),
"project.created" => Ok(Self::ProjectCreated),
"project.updated" => Ok(Self::ProjectUpdated),
"project.deleted" => Ok(Self::ProjectDeleted),
"organization.created" => Ok(Self::OrganizationCreated),
"organization.updated" => Ok(Self::OrganizationUpdated),
"organization.deleted" => Ok(Self::OrganizationDeleted),
"oauth.refreshed" => Ok(Self::OauthRefreshed),
"oauth.failed" => Ok(Self::OauthFailed),
"passthrough.executed" => Ok(Self::PassthroughExecuted),
"member.added" => Ok(Self::MemberAdded),
"member.removed" => Ok(Self::MemberRemoved),
"member.role_updated" => Ok(Self::MemberRoleUpdated),
"grant.created" => Ok(Self::GrantCreated),
"grant.updated" => Ok(Self::GrantUpdated),
"grant.revoked" => Ok(Self::GrantRevoked),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookEventType {
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 WebhookEventType {
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 WebhookEventType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
/**Every webhook event and the payload its deliveries carry.
The single declaration of the catalog: [`WebhookEventType`] is derived from
it, so an event cannot exist without a payload and the two cannot drift.
Never serialized: a delivery puts the bare payload under `payload` with the
discriminant in the sibling `event` field. The serde tag exists so utoipa
derives a `oneOf` with a `discriminator` whose `mapping` pairs every event
with its payload schema - that mapping is what the SDK generators read, and
it comes from this declaration rather than being restated anywhere.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Every webhook event and the payload its deliveries carry.\n\nThe single declaration of the catalog: [`WebhookEventType`] is derived from\nit, so an event cannot exist without a payload and the two cannot drift.\n\nNever serialized: a delivery puts the bare payload under `payload` with the\ndiscriminant in the sibling `event` field. The serde tag exists so utoipa\nderives a `oneOf` with a `discriminator` whose `mapping` pairs every event\nwith its payload schema - that mapping is what the SDK generators read, and\nit comes from this declaration rather than being restated anywhere.",
/// "oneOf": [
/// {
/// "description": "Emitted when a new non-OAuth connection is created",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/ConnectionCreatedPayload"
/// },
/// {
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "type": {
/// "type": "string",
/// "enum": [
/// "connection.created"
/// ]
/// }
/// }
/// }
/// ]
/// },
/// {
/// "description": "Emitted when an OAuth connection is created",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/ConnectionOAuthCreatedPayload"
/// },
/// {
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "type": {
/// "type": "string",
/// "enum": [
/// "connection.oauth.created"
/// ]
/// }
/// }
/// }
/// ]
/// },
/// {
/// "description": "Emitted when a connection's own fields change",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/ConnectionUpdatedPayload"
/// },
/// {
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "type": {
/// "type": "string",
/// "enum": [
/// "connection.updated"
/// ]
/// }
/// }
/// }
/// ]
/// },
/// {
/// "description": "Emitted when a connection is deleted",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/ConnectionDeletedPayload"
/// },
/// {
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "type": {
/// "type": "string",
/// "enum": [
/// "connection.deleted"
/// ]
/// }
/// }
/// }
/// ]
/// },
/// {
/// "description": "Emitted when an API key is created",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/ApiKeyCreatedPayload"
/// },
/// {
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "type": {
/// "type": "string",
/// "enum": [
/// "api_key.created"
/// ]
/// }
/// }
/// }
/// ]
/// },
/// {
/// "description": "Emitted when an API key is revoked",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/ApiKeyRevokedPayload"
/// },
/// {
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "type": {
/// "type": "string",
/// "enum": [
/// "api_key.revoked"
/// ]
/// }
/// }
/// }
/// ]
/// },
/// {
/// "description": "Emitted when a project is created",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/ProjectCreatedPayload"
/// },
/// {
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "type": {
/// "type": "string",
/// "enum": [
/// "project.created"
/// ]
/// }
/// }
/// }
/// ]
/// },
/// {
/// "description": "Emitted when a project is updated",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/ProjectUpdatedPayload"
/// },
/// {
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "type": {
/// "type": "string",
/// "enum": [
/// "project.updated"
/// ]
/// }
/// }
/// }
/// ]
/// },
/// {
/// "description": "Emitted when a project is deleted",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/ProjectDeletedPayload"
/// },
/// {
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "type": {
/// "type": "string",
/// "enum": [
/// "project.deleted"
/// ]
/// }
/// }
/// }
/// ]
/// },
/// {
/// "description": "Emitted when an organization is created",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/OrganizationCreatedPayload"
/// },
/// {
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "type": {
/// "type": "string",
/// "enum": [
/// "organization.created"
/// ]
/// }
/// }
/// }
/// ]
/// },
/// {
/// "description": "Emitted when an organization is updated",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/OrganizationUpdatedPayload"
/// },
/// {
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "type": {
/// "type": "string",
/// "enum": [
/// "organization.updated"
/// ]
/// }
/// }
/// }
/// ]
/// },
/// {
/// "description": "Emitted when an organization is deleted",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/OrganizationDeletedPayload"
/// },
/// {
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "type": {
/// "type": "string",
/// "enum": [
/// "organization.deleted"
/// ]
/// }
/// }
/// }
/// ]
/// },
/// {
/// "description": "Emitted when OAuth token is refreshed",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/OAuthRefreshedPayload"
/// },
/// {
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "type": {
/// "type": "string",
/// "enum": [
/// "oauth.refreshed"
/// ]
/// }
/// }
/// }
/// ]
/// },
/// {
/// "description": "Emitted when OAuth authorization fails",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/OAuthFailedPayload"
/// },
/// {
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "type": {
/// "type": "string",
/// "enum": [
/// "oauth.failed"
/// ]
/// }
/// }
/// }
/// ]
/// },
/// {
/// "description": "Emitted when a passthrough request is executed",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/PassthroughExecutedPayload"
/// },
/// {
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "type": {
/// "type": "string",
/// "enum": [
/// "passthrough.executed"
/// ]
/// }
/// }
/// }
/// ]
/// },
/// {
/// "description": "Emitted when a member is added to an organization or project",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/MemberAddedPayload"
/// },
/// {
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "type": {
/// "type": "string",
/// "enum": [
/// "member.added"
/// ]
/// }
/// }
/// }
/// ]
/// },
/// {
/// "description": "Emitted when a member is removed from an organization or project",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/MemberRemovedPayload"
/// },
/// {
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "type": {
/// "type": "string",
/// "enum": [
/// "member.removed"
/// ]
/// }
/// }
/// }
/// ]
/// },
/// {
/// "description": "Emitted when a member's role is updated",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/MemberRoleUpdatedPayload"
/// },
/// {
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "type": {
/// "type": "string",
/// "enum": [
/// "member.role_updated"
/// ]
/// }
/// }
/// }
/// ]
/// },
/// {
/// "description": "Emitted when a consent creates a grant: a user's first for an\napplication, or any after they revoked it.\n\nCaptured when the consent commits, before the authorization flow\nvalidates the requested scope, so the reach it describes is written\nmoments later when the code is issued.",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/GrantCreatedPayload"
/// },
/// {
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "type": {
/// "type": "string",
/// "enum": [
/// "grant.created"
/// ]
/// }
/// }
/// }
/// ]
/// },
/// {
/// "description": "Emitted when a live grant's reach changes, by re-consent or by the user\nediting it",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/GrantUpdatedPayload"
/// },
/// {
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "type": {
/// "type": "string",
/// "enum": [
/// "grant.updated"
/// ]
/// }
/// }
/// }
/// ]
/// },
/// {
/// "description": "Emitted when a grant is revoked, by its user or by the application's\ndeveloper",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/GrantRevokedPayload"
/// },
/// {
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "type": {
/// "type": "string",
/// "enum": [
/// "grant.revoked"
/// ]
/// }
/// }
/// }
/// ]
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum WebhookPayload {
Variant0 {
connection_id: ::uuid::Uuid,
connection_type: ::std::string::String,
created_at: ::chrono::DateTime<::chrono::offset::Utc>,
environment: ::std::string::String,
key: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
organization_id: ::std::option::Option<::uuid::Uuid>,
platform: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
project_id: ::std::option::Option<::uuid::Uuid>,
state: ::std::string::String,
#[serde(rename = "type")]
type_: WebhookPayloadVariant0Type,
},
Variant1 {
authorized_at: ::chrono::DateTime<::chrono::offset::Utc>,
connection_id: ::uuid::Uuid,
key: ::std::string::String,
platform: ::std::string::String,
#[serde(rename = "type")]
type_: WebhookPayloadVariant1Type,
user_id: ::uuid::Uuid,
},
Variant2 {
connection_id: ::uuid::Uuid,
key: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
organization_id: ::std::option::Option<::uuid::Uuid>,
platform: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
project_id: ::std::option::Option<::uuid::Uuid>,
tags: ::std::vec::Vec<::std::string::String>,
#[serde(rename = "type")]
type_: WebhookPayloadVariant2Type,
updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
},
Variant3 {
connection_id: ::uuid::Uuid,
deleted_at: ::chrono::DateTime<::chrono::offset::Utc>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
key: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
organization_id: ::std::option::Option<::uuid::Uuid>,
platform: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
project_id: ::std::option::Option<::uuid::Uuid>,
#[serde(rename = "type")]
type_: WebhookPayloadVariant3Type,
},
Variant4 {
connection_type: ::std::string::String,
created_at: ::chrono::DateTime<::chrono::offset::Utc>,
environment: ::std::string::String,
event_access_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
project_id: ::std::option::Option<::uuid::Uuid>,
#[serde(rename = "type")]
type_: WebhookPayloadVariant4Type,
},
Variant5 {
connection_type: ::std::string::String,
environment: ::std::string::String,
event_access_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
project_id: ::std::option::Option<::uuid::Uuid>,
revoked_at: ::chrono::DateTime<::chrono::offset::Utc>,
#[serde(rename = "type")]
type_: WebhookPayloadVariant5Type,
},
Variant6 {
created_at: ::chrono::DateTime<::chrono::offset::Utc>,
id: ::uuid::Uuid,
name: ::std::string::String,
organization_id: ::uuid::Uuid,
#[serde(rename = "type")]
type_: WebhookPayloadVariant6Type,
},
Variant7 {
id: ::uuid::Uuid,
name: ::std::string::String,
organization_id: ::uuid::Uuid,
#[serde(rename = "type")]
type_: WebhookPayloadVariant7Type,
updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
},
Variant8 {
deleted_at: ::chrono::DateTime<::chrono::offset::Utc>,
id: ::uuid::Uuid,
name: ::std::string::String,
organization_id: ::uuid::Uuid,
#[serde(rename = "type")]
type_: WebhookPayloadVariant8Type,
},
Variant9 {
created_at: ::chrono::DateTime<::chrono::offset::Utc>,
id: ::uuid::Uuid,
name: ::std::string::String,
#[serde(rename = "type")]
type_: WebhookPayloadVariant9Type,
},
Variant10 {
id: ::uuid::Uuid,
name: ::std::string::String,
#[serde(rename = "type")]
type_: WebhookPayloadVariant10Type,
updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
},
Variant11 {
deleted_at: ::chrono::DateTime<::chrono::offset::Utc>,
id: ::uuid::Uuid,
name: ::std::string::String,
#[serde(rename = "type")]
type_: WebhookPayloadVariant11Type,
},
Variant12 {
connection_id: ::uuid::Uuid,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
key: ::std::option::Option<::std::string::String>,
platform: ::std::string::String,
refreshed_at: ::chrono::DateTime<::chrono::offset::Utc>,
#[serde(rename = "type")]
type_: WebhookPayloadVariant12Type,
},
Variant13 {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
connection_id: ::std::option::Option<::uuid::Uuid>,
error: ::std::string::String,
failed_at: ::chrono::DateTime<::chrono::offset::Utc>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
key: ::std::option::Option<::std::string::String>,
platform: ::std::string::String,
#[serde(rename = "type")]
type_: WebhookPayloadVariant13Type,
},
Variant14 {
connection_id: ::uuid::Uuid,
duration_ms: i64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
error: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
key: ::std::option::Option<::std::string::String>,
method: ::std::string::String,
path: ::std::string::String,
platform: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
status_code: ::std::option::Option<i32>,
timestamp: ::chrono::DateTime<::chrono::offset::Utc>,
#[serde(rename = "type")]
type_: WebhookPayloadVariant14Type,
},
Variant15 {
added_at: ::chrono::DateTime<::chrono::offset::Utc>,
email: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
organization_name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
project_id: ::std::option::Option<::uuid::Uuid>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
project_name: ::std::option::Option<::std::string::String>,
#[serde(rename = "type")]
type_: WebhookPayloadVariant15Type,
user_id: ::uuid::Uuid,
},
Variant16 {
email: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
organization_name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
project_id: ::std::option::Option<::uuid::Uuid>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
project_name: ::std::option::Option<::std::string::String>,
removed_at: ::chrono::DateTime<::chrono::offset::Utc>,
#[serde(rename = "type")]
type_: WebhookPayloadVariant16Type,
user_id: ::uuid::Uuid,
},
Variant17 {
email: ::std::string::String,
new_role: ::std::string::String,
old_role: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
organization_name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
project_id: ::std::option::Option<::uuid::Uuid>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
project_name: ::std::option::Option<::std::string::String>,
#[serde(rename = "type")]
type_: WebhookPayloadVariant17Type,
updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
user_id: ::uuid::Uuid,
},
Variant18 {
/**The public `client_id` the application knows itself by, not the integer
key.*/
client_id: ::std::string::String,
connect_user_id: ::std::string::String,
/**Where the user answered: the page One renders, or the connect card
framed inside the application's own site.*/
consent_surface: WebhookPayloadVariant18ConsentSurface,
created_at: ::chrono::DateTime<::chrono::offset::Utc>,
environment: WebhookPayloadVariant18Environment,
grant_id: ::std::string::String,
#[serde(rename = "type")]
type_: WebhookPayloadVariant18Type,
/**Which revision of this grant's reach the delivery describes. Bumped by
every consent and every edit, so an application can tell a change it
has already applied from one it has not.
Two things it is not. It counts within one grant rather than across a
user, so a grant created after a revocation starts at 1 again and the
comparison has to be keyed by `grant_id`. And `grant.revoked` repeats
the version the grant last reached rather than taking a new one,
because revoking changes who may act and not what the grant describes -
so it is the one event in the family that must not be discarded as
already-seen. Deduplicate on `X-Webhook-Event-Id`, never on this.*/
version: i64,
},
Variant19 {
/**The public `client_id` the application knows itself by, not the integer
key.*/
client_id: ::std::string::String,
connect_user_id: ::std::string::String,
environment: WebhookPayloadVariant19Environment,
grant_id: ::std::string::String,
/**What moved a live grant.
One field on `grant.updated` rather than two events: an application can
prompt the user to re-consent and cannot prompt them to un-edit, so it
branches on this, but it is one occurrence either way.*/
source: WebhookPayloadVariant19Source,
#[serde(rename = "type")]
type_: WebhookPayloadVariant19Type,
updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
/**Which revision of this grant's reach the delivery describes. Bumped by
every consent and every edit, so an application can tell a change it
has already applied from one it has not.
Two things it is not. It counts within one grant rather than across a
user, so a grant created after a revocation starts at 1 again and the
comparison has to be keyed by `grant_id`. And `grant.revoked` repeats
the version the grant last reached rather than taking a new one,
because revoking changes who may act and not what the grant describes -
so it is the one event in the family that must not be discarded as
already-seen. Deduplicate on `X-Webhook-Event-Id`, never on this.*/
version: i64,
},
Variant20 {
/**The public `client_id` the application knows itself by, not the integer
key.*/
client_id: ::std::string::String,
connect_user_id: ::std::string::String,
environment: WebhookPayloadVariant20Environment,
grant_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
reason: ::std::option::Option<::std::string::String>,
revoked_at: ::chrono::DateTime<::chrono::offset::Utc>,
/**Who ended a grant, which decides how the application answers: after the
user or a departure it may prompt the user to reconnect, and after the
application's owner or a tenant admin ended it deliberately it does not.
One field rather than one event per actor.*/
revoked_by: WebhookPayloadVariant20RevokedBy,
#[serde(rename = "type")]
type_: WebhookPayloadVariant20Type,
/**Which revision of this grant's reach the delivery describes. Bumped by
every consent and every edit, so an application can tell a change it
has already applied from one it has not.
Two things it is not. It counts within one grant rather than across a
user, so a grant created after a revocation starts at 1 again and the
comparison has to be keyed by `grant_id`. And `grant.revoked` repeats
the version the grant last reached rather than taking a new one,
because revoking changes who may act and not what the grant describes -
so it is the one event in the family that must not be discarded as
already-seen. Deduplicate on `X-Webhook-Event-Id`, never on this.*/
version: i64,
},
}
///`WebhookPayloadVariant0Type`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "connection.created"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant0Type {
#[serde(rename = "connection.created")]
ConnectionCreated,
}
impl ::std::fmt::Display for WebhookPayloadVariant0Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::ConnectionCreated => f.write_str("connection.created"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant0Type {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"connection.created" => Ok(Self::ConnectionCreated),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant0Type {
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 WebhookPayloadVariant0Type {
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 WebhookPayloadVariant0Type {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant10Type`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "organization.updated"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant10Type {
#[serde(rename = "organization.updated")]
OrganizationUpdated,
}
impl ::std::fmt::Display for WebhookPayloadVariant10Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::OrganizationUpdated => f.write_str("organization.updated"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant10Type {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"organization.updated" => Ok(Self::OrganizationUpdated),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant10Type {
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 WebhookPayloadVariant10Type {
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 WebhookPayloadVariant10Type {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant11Type`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "organization.deleted"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant11Type {
#[serde(rename = "organization.deleted")]
OrganizationDeleted,
}
impl ::std::fmt::Display for WebhookPayloadVariant11Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::OrganizationDeleted => f.write_str("organization.deleted"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant11Type {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"organization.deleted" => Ok(Self::OrganizationDeleted),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant11Type {
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 WebhookPayloadVariant11Type {
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 WebhookPayloadVariant11Type {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant12Type`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "oauth.refreshed"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant12Type {
#[serde(rename = "oauth.refreshed")]
OauthRefreshed,
}
impl ::std::fmt::Display for WebhookPayloadVariant12Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::OauthRefreshed => f.write_str("oauth.refreshed"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant12Type {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"oauth.refreshed" => Ok(Self::OauthRefreshed),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant12Type {
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 WebhookPayloadVariant12Type {
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 WebhookPayloadVariant12Type {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant13Type`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "oauth.failed"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant13Type {
#[serde(rename = "oauth.failed")]
OauthFailed,
}
impl ::std::fmt::Display for WebhookPayloadVariant13Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::OauthFailed => f.write_str("oauth.failed"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant13Type {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"oauth.failed" => Ok(Self::OauthFailed),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant13Type {
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 WebhookPayloadVariant13Type {
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 WebhookPayloadVariant13Type {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant14Type`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "passthrough.executed"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant14Type {
#[serde(rename = "passthrough.executed")]
PassthroughExecuted,
}
impl ::std::fmt::Display for WebhookPayloadVariant14Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::PassthroughExecuted => f.write_str("passthrough.executed"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant14Type {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"passthrough.executed" => Ok(Self::PassthroughExecuted),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant14Type {
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 WebhookPayloadVariant14Type {
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 WebhookPayloadVariant14Type {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant15Type`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "member.added"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant15Type {
#[serde(rename = "member.added")]
MemberAdded,
}
impl ::std::fmt::Display for WebhookPayloadVariant15Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::MemberAdded => f.write_str("member.added"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant15Type {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"member.added" => Ok(Self::MemberAdded),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant15Type {
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 WebhookPayloadVariant15Type {
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 WebhookPayloadVariant15Type {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant16Type`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "member.removed"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant16Type {
#[serde(rename = "member.removed")]
MemberRemoved,
}
impl ::std::fmt::Display for WebhookPayloadVariant16Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::MemberRemoved => f.write_str("member.removed"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant16Type {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"member.removed" => Ok(Self::MemberRemoved),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant16Type {
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 WebhookPayloadVariant16Type {
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 WebhookPayloadVariant16Type {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant17Type`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "member.role_updated"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant17Type {
#[serde(rename = "member.role_updated")]
MemberRoleUpdated,
}
impl ::std::fmt::Display for WebhookPayloadVariant17Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::MemberRoleUpdated => f.write_str("member.role_updated"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant17Type {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"member.role_updated" => Ok(Self::MemberRoleUpdated),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant17Type {
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 WebhookPayloadVariant17Type {
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 WebhookPayloadVariant17Type {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
/**Where the user answered: the page One renders, or the connect card
framed inside the application's own site.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Where the user answered: the page One renders, or the connect card\nframed inside the application's own site.",
/// "oneOf": [
/// {
/// "description": "Where an OAuth client's users are sent to grant consent.\n\nThe surface used to be read off the client id, so a client could only get a\ndifferent one by being renamed, and every existing client would have moved\nthe moment the rule changed. Naming it on the row makes it a property of the\nclient that its owner can see and set, and leaves the ones already running\nexactly where they are.",
/// "type": "string",
/// "enum": [
/// "hosted",
/// "connect"
/// ]
/// }
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant18ConsentSurface {
/**Where an OAuth client's users are sent to grant consent.
The surface used to be read off the client id, so a client could only get a
different one by being renamed, and every existing client would have moved
the moment the rule changed. Naming it on the row makes it a property of the
client that its owner can see and set, and leaves the ones already running
exactly where they are.*/
#[serde(rename = "hosted")]
Hosted,
/**Where an OAuth client's users are sent to grant consent.
The surface used to be read off the client id, so a client could only get a
different one by being renamed, and every existing client would have moved
the moment the rule changed. Naming it on the row makes it a property of the
client that its owner can see and set, and leaves the ones already running
exactly where they are.*/
#[serde(rename = "connect")]
Connect,
}
impl ::std::fmt::Display for WebhookPayloadVariant18ConsentSurface {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Hosted => f.write_str("hosted"),
Self::Connect => f.write_str("connect"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant18ConsentSurface {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"hosted" => Ok(Self::Hosted),
"connect" => Ok(Self::Connect),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant18ConsentSurface {
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 WebhookPayloadVariant18ConsentSurface {
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 WebhookPayloadVariant18ConsentSurface {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant18Environment`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "test",
/// "live"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant18Environment {
#[serde(rename = "test")]
Test,
#[serde(rename = "live")]
Live,
}
impl ::std::fmt::Display for WebhookPayloadVariant18Environment {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Test => f.write_str("test"),
Self::Live => f.write_str("live"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant18Environment {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"test" => Ok(Self::Test),
"live" => Ok(Self::Live),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant18Environment {
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 WebhookPayloadVariant18Environment {
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 WebhookPayloadVariant18Environment {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant18Type`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "grant.created"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant18Type {
#[serde(rename = "grant.created")]
GrantCreated,
}
impl ::std::fmt::Display for WebhookPayloadVariant18Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::GrantCreated => f.write_str("grant.created"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant18Type {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"grant.created" => Ok(Self::GrantCreated),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant18Type {
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 WebhookPayloadVariant18Type {
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 WebhookPayloadVariant18Type {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant19Environment`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "test",
/// "live"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant19Environment {
#[serde(rename = "test")]
Test,
#[serde(rename = "live")]
Live,
}
impl ::std::fmt::Display for WebhookPayloadVariant19Environment {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Test => f.write_str("test"),
Self::Live => f.write_str("live"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant19Environment {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"test" => Ok(Self::Test),
"live" => Ok(Self::Live),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant19Environment {
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 WebhookPayloadVariant19Environment {
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 WebhookPayloadVariant19Environment {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
/**What moved a live grant.
One field on `grant.updated` rather than two events: an application can
prompt the user to re-consent and cannot prompt them to un-edit, so it
branches on this, but it is one occurrence either way.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "What moved a live grant.\n\nOne field on `grant.updated` rather than two events: an application can\nprompt the user to re-consent and cannot prompt them to un-edit, so it\nbranches on this, but it is one occurrence either way.",
/// "type": "string",
/// "enum": [
/// "consent",
/// "user_edit"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant19Source {
#[serde(rename = "consent")]
Consent,
#[serde(rename = "user_edit")]
UserEdit,
}
impl ::std::fmt::Display for WebhookPayloadVariant19Source {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Consent => f.write_str("consent"),
Self::UserEdit => f.write_str("user_edit"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant19Source {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"consent" => Ok(Self::Consent),
"user_edit" => Ok(Self::UserEdit),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant19Source {
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 WebhookPayloadVariant19Source {
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 WebhookPayloadVariant19Source {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant19Type`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "grant.updated"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant19Type {
#[serde(rename = "grant.updated")]
GrantUpdated,
}
impl ::std::fmt::Display for WebhookPayloadVariant19Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::GrantUpdated => f.write_str("grant.updated"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant19Type {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"grant.updated" => Ok(Self::GrantUpdated),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant19Type {
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 WebhookPayloadVariant19Type {
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 WebhookPayloadVariant19Type {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant1Type`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "connection.oauth.created"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant1Type {
#[serde(rename = "connection.oauth.created")]
ConnectionOauthCreated,
}
impl ::std::fmt::Display for WebhookPayloadVariant1Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::ConnectionOauthCreated => f.write_str("connection.oauth.created"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant1Type {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"connection.oauth.created" => Ok(Self::ConnectionOauthCreated),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant1Type {
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 WebhookPayloadVariant1Type {
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 WebhookPayloadVariant1Type {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant20Environment`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "test",
/// "live"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant20Environment {
#[serde(rename = "test")]
Test,
#[serde(rename = "live")]
Live,
}
impl ::std::fmt::Display for WebhookPayloadVariant20Environment {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Test => f.write_str("test"),
Self::Live => f.write_str("live"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant20Environment {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"test" => Ok(Self::Test),
"live" => Ok(Self::Live),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant20Environment {
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 WebhookPayloadVariant20Environment {
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 WebhookPayloadVariant20Environment {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
/**Who ended a grant, which decides how the application answers: after the
user or a departure it may prompt the user to reconnect, and after the
application's owner or a tenant admin ended it deliberately it does not.
One field rather than one event per actor.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Who ended a grant, which decides how the application answers: after the\nuser or a departure it may prompt the user to reconnect, and after the\napplication's owner or a tenant admin ended it deliberately it does not.\nOne field rather than one event per actor.",
/// "type": "string",
/// "enum": [
/// "user",
/// "developer",
/// "departure",
/// "admin"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant20RevokedBy {
#[serde(rename = "user")]
User,
#[serde(rename = "developer")]
Developer,
#[serde(rename = "departure")]
Departure,
#[serde(rename = "admin")]
Admin,
}
impl ::std::fmt::Display for WebhookPayloadVariant20RevokedBy {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::User => f.write_str("user"),
Self::Developer => f.write_str("developer"),
Self::Departure => f.write_str("departure"),
Self::Admin => f.write_str("admin"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant20RevokedBy {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"user" => Ok(Self::User),
"developer" => Ok(Self::Developer),
"departure" => Ok(Self::Departure),
"admin" => Ok(Self::Admin),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant20RevokedBy {
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 WebhookPayloadVariant20RevokedBy {
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 WebhookPayloadVariant20RevokedBy {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant20Type`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "grant.revoked"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant20Type {
#[serde(rename = "grant.revoked")]
GrantRevoked,
}
impl ::std::fmt::Display for WebhookPayloadVariant20Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::GrantRevoked => f.write_str("grant.revoked"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant20Type {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"grant.revoked" => Ok(Self::GrantRevoked),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant20Type {
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 WebhookPayloadVariant20Type {
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 WebhookPayloadVariant20Type {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant2Type`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "connection.updated"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant2Type {
#[serde(rename = "connection.updated")]
ConnectionUpdated,
}
impl ::std::fmt::Display for WebhookPayloadVariant2Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::ConnectionUpdated => f.write_str("connection.updated"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant2Type {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"connection.updated" => Ok(Self::ConnectionUpdated),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant2Type {
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 WebhookPayloadVariant2Type {
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 WebhookPayloadVariant2Type {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant3Type`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "connection.deleted"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant3Type {
#[serde(rename = "connection.deleted")]
ConnectionDeleted,
}
impl ::std::fmt::Display for WebhookPayloadVariant3Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::ConnectionDeleted => f.write_str("connection.deleted"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant3Type {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"connection.deleted" => Ok(Self::ConnectionDeleted),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant3Type {
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 WebhookPayloadVariant3Type {
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 WebhookPayloadVariant3Type {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant4Type`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "api_key.created"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant4Type {
#[serde(rename = "api_key.created")]
ApiKeyCreated,
}
impl ::std::fmt::Display for WebhookPayloadVariant4Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::ApiKeyCreated => f.write_str("api_key.created"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant4Type {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"api_key.created" => Ok(Self::ApiKeyCreated),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant4Type {
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 WebhookPayloadVariant4Type {
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 WebhookPayloadVariant4Type {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant5Type`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "api_key.revoked"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant5Type {
#[serde(rename = "api_key.revoked")]
ApiKeyRevoked,
}
impl ::std::fmt::Display for WebhookPayloadVariant5Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::ApiKeyRevoked => f.write_str("api_key.revoked"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant5Type {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"api_key.revoked" => Ok(Self::ApiKeyRevoked),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant5Type {
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 WebhookPayloadVariant5Type {
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 WebhookPayloadVariant5Type {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant6Type`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "project.created"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant6Type {
#[serde(rename = "project.created")]
ProjectCreated,
}
impl ::std::fmt::Display for WebhookPayloadVariant6Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::ProjectCreated => f.write_str("project.created"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant6Type {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"project.created" => Ok(Self::ProjectCreated),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant6Type {
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 WebhookPayloadVariant6Type {
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 WebhookPayloadVariant6Type {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant7Type`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "project.updated"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant7Type {
#[serde(rename = "project.updated")]
ProjectUpdated,
}
impl ::std::fmt::Display for WebhookPayloadVariant7Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::ProjectUpdated => f.write_str("project.updated"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant7Type {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"project.updated" => Ok(Self::ProjectUpdated),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant7Type {
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 WebhookPayloadVariant7Type {
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 WebhookPayloadVariant7Type {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant8Type`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "project.deleted"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant8Type {
#[serde(rename = "project.deleted")]
ProjectDeleted,
}
impl ::std::fmt::Display for WebhookPayloadVariant8Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::ProjectDeleted => f.write_str("project.deleted"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant8Type {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"project.deleted" => Ok(Self::ProjectDeleted),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant8Type {
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 WebhookPayloadVariant8Type {
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 WebhookPayloadVariant8Type {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookPayloadVariant9Type`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "organization.created"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant9Type {
#[serde(rename = "organization.created")]
OrganizationCreated,
}
impl ::std::fmt::Display for WebhookPayloadVariant9Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::OrganizationCreated => f.write_str("organization.created"),
}
}
}
impl ::std::str::FromStr for WebhookPayloadVariant9Type {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"organization.created" => Ok(Self::OrganizationCreated),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookPayloadVariant9Type {
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 WebhookPayloadVariant9Type {
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 WebhookPayloadVariant9Type {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`WebhookSubscriptionView`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "active",
/// "changeLog",
/// "consecutiveFailures",
/// "createdAt",
/// "deleted",
/// "events",
/// "id",
/// "key",
/// "sharing",
/// "tags",
/// "updatedAt",
/// "url",
/// "userId",
/// "version"
/// ],
/// "properties": {
/// "active": {
/// "type": "boolean"
/// },
/// "changeLog": {
/// "$ref": "#/components/schemas/ChangeLog"
/// },
/// "consecutiveFailures": {
/// "description": "Deliveries that have exhausted every attempt since the last one the\nendpoint accepted.",
/// "type": "integer",
/// "format": "int32"
/// },
/// "createdAt": {
/// "type": "string",
/// "format": "date-time"
/// },
/// "deleted": {
/// "type": "boolean"
/// },
/// "description": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "events": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "id": {
/// "type": "string",
/// "format": "uuid"
/// },
/// "key": {
/// "type": "string"
/// },
/// "metadata": {
/// "$ref": "#/components/schemas/Value"
/// },
/// "organizationId": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "projectId": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "resumeAt": {
/// "description": "When One will try a suspended endpoint again, or null once One has\nstopped retrying it. Null with `suspendedAt` set means delivery\nresumes only when the subscription is saved.",
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "date-time"
/// },
/// "sharing": {
/// "$ref": "#/components/schemas/ConnectionSharing"
/// },
/// "suspendedAt": {
/// "description": "When One stopped delivering because the endpoint kept failing. Null\nmeans One is still delivering; `active` is the subscriber's own switch\nand is reported separately.",
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "date-time"
/// },
/// "tags": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "updatedAt": {
/// "type": "string",
/// "format": "date-time"
/// },
/// "url": {
/// "type": "string"
/// },
/// "userId": {
/// "type": "string",
/// "format": "uuid"
/// },
/// "version": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WebhookSubscriptionView {
pub active: bool,
#[serde(rename = "changeLog")]
pub change_log: ChangeLog,
/**Deliveries that have exhausted every attempt since the last one the
endpoint accepted.*/
#[serde(rename = "consecutiveFailures")]
pub consecutive_failures: i32,
#[serde(rename = "createdAt")]
pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
pub deleted: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
pub events: ::std::vec::Vec<::std::string::String>,
pub id: ::uuid::Uuid,
pub key: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub metadata: ::std::option::Option<Value>,
#[serde(
rename = "organizationId",
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(
rename = "projectId",
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub project_id: ::std::option::Option<::uuid::Uuid>,
/**When One will try a suspended endpoint again, or null once One has
stopped retrying it. Null with `suspendedAt` set means delivery
resumes only when the subscription is saved.*/
#[serde(
rename = "resumeAt",
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub resume_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
pub sharing: ConnectionSharing,
/**When One stopped delivering because the endpoint kept failing. Null
means One is still delivering; `active` is the subscriber's own switch
and is reported separately.*/
#[serde(
rename = "suspendedAt",
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub suspended_at: ::std::option::Option<
::chrono::DateTime<::chrono::offset::Utc>,
>,
pub tags: ::std::vec::Vec<::std::string::String>,
#[serde(rename = "updatedAt")]
pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
pub url: ::std::string::String,
#[serde(rename = "userId")]
pub user_id: ::uuid::Uuid,
pub version: ::std::string::String,
}
}
#[derive(Clone, Debug)]
/**Client for One SDK
Curated One API surface for the One SDK.
Version: 0.1.0*/
pub struct Client {
pub(crate) baseurl: String,
pub(crate) client: reqwest::Client,
}
impl Client {
/// Create a new client.
///
/// `baseurl` is the base URL provided to the internal
/// `reqwest::Client`, and should include a scheme and hostname,
/// as well as port and a path stem if applicable.
pub fn new(baseurl: &str) -> Self {
#[cfg(not(target_arch = "wasm32"))]
let client = {
let dur = ::std::time::Duration::from_secs(15u64);
reqwest::ClientBuilder::new().connect_timeout(dur).timeout(dur)
};
#[cfg(target_arch = "wasm32")]
let client = reqwest::ClientBuilder::new();
Self::new_with_client(baseurl, client.build().unwrap())
}
/// Construct a new client with an existing `reqwest::Client`,
/// allowing more control over its configuration.
///
/// `baseurl` is the base URL provided to the internal
/// `reqwest::Client`, and should include a scheme and hostname,
/// as well as port and a path stem if applicable.
pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self {
Self {
baseurl: baseurl.to_string(),
client,
}
}
}
impl ClientInfo<()> for Client {
fn api_version() -> &'static str {
"0.1.0"
}
fn baseurl(&self) -> &str {
self.baseurl.as_str()
}
fn client(&self) -> &reqwest::Client {
&self.client
}
fn inner(&self) -> &() {
&()
}
}
impl ClientHooks<()> for &Client {}
#[allow(clippy::all)]
impl Client {
/**List reachable connections
Lists every connection the caller's grant reaches - the connections it can read plus the ones it can only run a custom action on - each labelled with the access it confers. A connection the grant cannot read carries only its key, connector and access label, never the connection record.
Sends a `GET` request to `/v1/connections/reachable`
Arguments:
- `limit`: Items per page. Default 20, hard-capped at 150. `limit=0` is
treated as 1. Larger values silently clamp. Absent until the request
or a caller names one, so a route with its own default can tell.
- `page`: Page number for pagination (1-indexed). Defaults to 1.
- `skip`: Number of items to skip before the first returned item. Defaults to 0.
Most callers should leave this at 0 and rely on `page` + `limit`.
- `x_one_organization_id`: Selects the tenant this request acts in. Omit it to act in your personal scope.
- `x_one_project_id`: Selects the tenant this request acts in. Omit it to act in your personal scope.
*/
pub async fn list_reachable_connections<'a>(
&'a self,
limit: Option<i64>,
page: Option<i64>,
skip: Option<i64>,
x_one_organization_id: Option<&'a ::uuid::Uuid>,
x_one_project_id: Option<&'a ::uuid::Uuid>,
) -> Result<
ResponseValue<types::PaginatedReachableConnectionView>,
Error<types::ErrorResponse>,
> {
let url = format!("{}/v1/connections/reachable", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
header_map
.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
if let Some(value) = x_one_organization_id {
header_map.append("X-One-Organization-Id", value.to_string().try_into()?);
}
if let Some(value) = x_one_project_id {
header_map.append("X-One-Project-Id", value.to_string().try_into()?);
}
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("page", &page))
.query(&progenitor_client::QueryParam::new("skip", &skip))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_reachable_connections",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => {
Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
}
401u16 => {
Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
}
402u16 => {
Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
}
403u16 => {
Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
}
404u16 => {
Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
}
502u16 => {
Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
}
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List vault connections
Returns the connections you have access to. The result is filtered to your scope automatically — your own connections, your organization's, or your project's, depending on the key you use. Filter further by platform, identity, key, or tags.
Sends a `GET` request to `/v1/vault/connections`
Arguments:
- `identity`: Filter by the upstream platform identity (e.g. the user's email
or remote account id) the connection authenticates as.
- `identity_type`: Restrict the result to connections of the given identity type
(`user`, `account`, `workspace`, etc.).
- `key`: Filter by exact connection key. Accepts a single key or a
comma-separated list.
- `limit`: Items per page. Default 20, hard-capped at 150. `limit=0` is
treated as 1. Larger values silently clamp. Absent until the request
or a caller names one, so a route with its own default can tell.
- `page`: Page number for pagination (1-indexed). Defaults to 1.
- `platform`: Filter by platform identifier (e.g. `gmail`, `shopify`).
- `skip`: Number of items to skip before the first returned item. Defaults to 0.
Most callers should leave this at 0 and rely on `page` + `limit`.
- `tags`: Filter by tags attached to the connection. Accepts a single tag
or a comma-separated list.
- `x_one_organization_id`: Selects the tenant this request acts in. Omit it to act in your personal scope.
- `x_one_project_id`: Selects the tenant this request acts in. Omit it to act in your personal scope.
*/
pub async fn list_vault_connections<'a>(
&'a self,
identity: Option<&'a str>,
identity_type: Option<types::ConnectionIdentityType>,
key: Option<&'a str>,
limit: Option<i64>,
page: Option<i64>,
platform: Option<&'a str>,
skip: Option<i64>,
tags: Option<&'a str>,
x_one_organization_id: Option<&'a ::uuid::Uuid>,
x_one_project_id: Option<&'a ::uuid::Uuid>,
) -> Result<
ResponseValue<types::PaginatedVaultConnectionView>,
Error<types::ErrorResponse>,
> {
let url = format!("{}/v1/vault/connections", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
header_map
.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
if let Some(value) = x_one_organization_id {
header_map.append("X-One-Organization-Id", value.to_string().try_into()?);
}
if let Some(value) = x_one_project_id {
header_map.append("X-One-Project-Id", value.to_string().try_into()?);
}
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("identity", &identity))
.query(&progenitor_client::QueryParam::new("identityType", &identity_type))
.query(&progenitor_client::QueryParam::new("key", &key))
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("page", &page))
.query(&progenitor_client::QueryParam::new("platform", &platform))
.query(&progenitor_client::QueryParam::new("skip", &skip))
.query(&progenitor_client::QueryParam::new("tags", &tags))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_vault_connections",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => {
Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
}
401u16 => {
Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
}
402u16 => {
Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
}
403u16 => {
Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
}
404u16 => {
Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
}
502u16 => {
Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
}
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Create or reconcile a webhook listener
Registers a listener under a stable name you choose. Calling it again with the same name reconciles the existing listener instead of creating a second one, so it is safe to run on every application boot. A signing secret is required, because deliveries are only signed when the subscription has one.
Sends a `PUT` request to `/v1/webhooks/subscriptions/by-key/{key}`
Arguments:
- `key`: Stable listener name, unique per account
- `body`
*/
pub async fn upsert_webhook_subscription<'a>(
&'a self,
key: &'a str,
body: &'a types::UpsertSubscriptionParams,
) -> Result<
ResponseValue<types::WebhookSubscriptionView>,
Error<types::ErrorResponse>,
> {
let url = format!(
"{}/v1/webhooks/subscriptions/by-key/{}", self.baseurl, encode_path(& key
.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map
.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "upsert_webhook_subscription",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => {
Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
}
402u16 => {
Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
}
403u16 => {
Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
}
404u16 => {
Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
}
500u16 => {
Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
}
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
/// Items consumers will typically use such as the Client.
pub mod prelude {
#[allow(unused_imports)]
pub use super::Client;
}