#[allow(unused_imports)]
pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue};
#[allow(unused_imports)]
use progenitor_client::{
encode_path, ClientHooks, OperationInfo, QueryParam, RequestBuilderExt,
};
pub mod prelude {
#[allow(unused_imports)]
pub use super::Client;
}
#[allow(clippy::all)]
pub mod types {
#[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()
}
}
#[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()
}
}
#[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(skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub project_id: ::std::option::Option<::uuid::Uuid>,
}
#[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(skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub project_id: ::std::option::Option<::uuid::Uuid>,
pub revoked_at: ::chrono::DateTime<::chrono::offset::Utc>,
}
#[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)
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(tag = "policy")]
pub enum ConnectionAccess {
#[serde(rename = "full")]
Full,
#[serde(rename = "methods")]
Methods {
access: ::std::vec::Vec<ActionAccess>,
methods: ::std::vec::Vec<Method>,
},
#[serde(rename = "actions")]
Actions { actions: ::std::vec::Vec<GrantedAction> },
}
#[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(skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub organization_id: ::std::option::Option<::uuid::Uuid>,
pub platform: ::std::string::String,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub project_id: ::std::option::Option<::uuid::Uuid>,
pub state: ::std::string::String,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ConnectionDeletedPayload {
pub connection_id: ::uuid::Uuid,
pub deleted_at: ::chrono::DateTime<::chrono::offset::Utc>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub key: ::std::option::Option<::std::string::String>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub organization_id: ::std::option::Option<::uuid::Uuid>,
pub platform: ::std::string::String,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub project_id: ::std::option::Option<::uuid::Uuid>,
}
#[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()
}
}
#[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,
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ConnectionUpdatedPayload {
pub connection_id: ::uuid::Uuid,
pub key: ::std::string::String,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub organization_id: ::std::option::Option<::uuid::Uuid>,
pub platform: ::std::string::String,
#[serde(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>,
}
#[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,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GrantCreatedPayload {
pub client_id: ::std::string::String,
pub connect_user_id: ::std::string::String,
pub consent_surface: GrantCreatedPayloadConsentSurface,
pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
pub environment: GrantCreatedPayloadEnvironment,
pub grant_id: ::std::string::String,
pub version: i64,
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum GrantCreatedPayloadConsentSurface {
#[serde(rename = "hosted")]
Hosted,
#[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()
}
}
#[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()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GrantRevokedPayload {
pub client_id: ::std::string::String,
pub connect_user_id: ::std::string::String,
pub environment: GrantRevokedPayloadEnvironment,
pub grant_id: ::std::string::String,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub reason: ::std::option::Option<::std::string::String>,
pub revoked_at: ::chrono::DateTime<::chrono::offset::Utc>,
pub revoked_by: GrantRevokedPayloadRevokedBy,
pub version: i64,
}
#[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()
}
}
#[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()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GrantUpdatedPayload {
pub client_id: ::std::string::String,
pub connect_user_id: ::std::string::String,
pub environment: GrantUpdatedPayloadEnvironment,
pub grant_id: ::std::string::String,
pub source: GrantUpdatedPayloadSource,
pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
pub version: i64,
}
#[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()
}
}
#[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()
}
}
#[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,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MemberAddedPayload {
pub added_at: ::chrono::DateTime<::chrono::offset::Utc>,
pub email: ::std::string::String,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub organization_name: ::std::option::Option<::std::string::String>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub project_id: ::std::option::Option<::uuid::Uuid>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub project_name: ::std::option::Option<::std::string::String>,
pub user_id: ::uuid::Uuid,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MemberRemovedPayload {
pub email: ::std::string::String,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub organization_name: ::std::option::Option<::std::string::String>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub project_id: ::std::option::Option<::uuid::Uuid>,
#[serde(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,
}
#[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(skip_serializing_if = "::std::option::Option::is_none")]
pub organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub organization_name: ::std::option::Option<::std::string::String>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub project_id: ::std::option::Option<::uuid::Uuid>,
#[serde(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,
}
#[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()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OAuthFailedPayload {
#[serde(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(skip_serializing_if = "::std::option::Option::is_none")]
pub key: ::std::option::Option<::std::string::String>,
pub platform: ::std::string::String,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OAuthRefreshedPayload {
pub connection_id: ::uuid::Uuid,
#[serde(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>,
}
#[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,
}
#[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,
}
#[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>,
}
#[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,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedReachableConnectionViewRowsItem {
pub access: ConnectionAccess,
pub connector: ::std::string::String,
#[serde(rename = "displayLabel")]
pub display_label: ::std::string::String,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub image: ::std::option::Option<::std::string::String>,
pub key: ::std::string::String,
pub label: ::std::string::String,
#[serde(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(skip_serializing_if = "::std::option::Option::is_none")]
pub title: ::std::option::Option<::std::string::String>,
#[serde(rename = "viewerAccessLevel")]
pub viewer_access_level: AccessLevel,
}
#[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,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedVaultConnectionViewRowsItem {
pub active: bool,
#[serde(rename = "addedBy")]
pub added_by: ::uuid::Uuid,
pub connector: ::std::string::String,
pub description: ::std::string::String,
#[serde(rename = "displayLabel")]
pub display_label: ::std::string::String,
pub environment: SecretKeyEnvironment,
pub id: ::uuid::Uuid,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub identity: ::std::option::Option<::std::string::String>,
#[serde(
rename = "identityType",
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,
pub label: ::std::string::String,
#[serde(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(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,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PassthroughExecutedPayload {
pub connection_id: ::uuid::Uuid,
pub duration_ms: i64,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub error: ::std::option::Option<::std::string::String>,
#[serde(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(skip_serializing_if = "::std::option::Option::is_none")]
pub status_code: ::std::option::Option<i32>,
pub timestamp: ::chrono::DateTime<::chrono::offset::Utc>,
}
#[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,
}
#[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,
}
#[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>,
}
#[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()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UpsertSubscriptionParams {
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub active: ::std::option::Option<bool>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
pub events: ::std::vec::Vec<WebhookEventType>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub metadata: ::std::option::Option<Value>,
pub secret: ::std::string::String,
pub url: ::std::string::String,
}
#[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)
}
}
#[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()
}
}
#[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(skip_serializing_if = "::std::option::Option::is_none")]
name: ::std::option::Option<::std::string::String>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
organization_id: ::std::option::Option<::uuid::Uuid>,
platform: ::std::string::String,
#[serde(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(skip_serializing_if = "::std::option::Option::is_none")]
name: ::std::option::Option<::std::string::String>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
organization_id: ::std::option::Option<::uuid::Uuid>,
platform: ::std::string::String,
#[serde(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(skip_serializing_if = "::std::option::Option::is_none")]
key: ::std::option::Option<::std::string::String>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
name: ::std::option::Option<::std::string::String>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
organization_id: ::std::option::Option<::uuid::Uuid>,
platform: ::std::string::String,
#[serde(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(skip_serializing_if = "::std::option::Option::is_none")]
name: ::std::option::Option<::std::string::String>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(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(skip_serializing_if = "::std::option::Option::is_none")]
name: ::std::option::Option<::std::string::String>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(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(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(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(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(skip_serializing_if = "::std::option::Option::is_none")]
error: ::std::option::Option<::std::string::String>,
#[serde(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(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(skip_serializing_if = "::std::option::Option::is_none")]
organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
organization_name: ::std::option::Option<::std::string::String>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
project_id: ::std::option::Option<::uuid::Uuid>,
#[serde(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(skip_serializing_if = "::std::option::Option::is_none")]
organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
organization_name: ::std::option::Option<::std::string::String>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
project_id: ::std::option::Option<::uuid::Uuid>,
#[serde(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(skip_serializing_if = "::std::option::Option::is_none")]
organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
organization_name: ::std::option::Option<::std::string::String>,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
project_id: ::std::option::Option<::uuid::Uuid>,
#[serde(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 {
client_id: ::std::string::String,
connect_user_id: ::std::string::String,
consent_surface: WebhookPayloadVariant18ConsentSurface,
created_at: ::chrono::DateTime<::chrono::offset::Utc>,
environment: WebhookPayloadVariant18Environment,
grant_id: ::std::string::String,
#[serde(rename = "type")]
type_: WebhookPayloadVariant18Type,
version: i64,
},
Variant19 {
client_id: ::std::string::String,
connect_user_id: ::std::string::String,
environment: WebhookPayloadVariant19Environment,
grant_id: ::std::string::String,
source: WebhookPayloadVariant19Source,
#[serde(rename = "type")]
type_: WebhookPayloadVariant19Type,
updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
version: i64,
},
Variant20 {
client_id: ::std::string::String,
connect_user_id: ::std::string::String,
environment: WebhookPayloadVariant20Environment,
grant_id: ::std::string::String,
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
reason: ::std::option::Option<::std::string::String>,
revoked_at: ::chrono::DateTime<::chrono::offset::Utc>,
revoked_by: WebhookPayloadVariant20RevokedBy,
#[serde(rename = "type")]
type_: WebhookPayloadVariant20Type,
version: i64,
},
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum WebhookPayloadVariant18ConsentSurface {
#[serde(rename = "hosted")]
Hosted,
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[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()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WebhookSubscriptionView {
pub active: bool,
#[serde(rename = "changeLog")]
pub change_log: ChangeLog,
#[serde(rename = "consecutiveFailures")]
pub consecutive_failures: i32,
#[serde(rename = "createdAt")]
pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
pub deleted: bool,
#[serde(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(skip_serializing_if = "::std::option::Option::is_none")]
pub metadata: ::std::option::Option<Value>,
#[serde(
rename = "organizationId",
skip_serializing_if = "::std::option::Option::is_none"
)]
pub organization_id: ::std::option::Option<::uuid::Uuid>,
#[serde(
rename = "projectId",
skip_serializing_if = "::std::option::Option::is_none"
)]
pub project_id: ::std::option::Option<::uuid::Uuid>,
#[serde(
rename = "resumeAt",
skip_serializing_if = "::std::option::Option::is_none"
)]
pub resume_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
pub sharing: ConnectionSharing,
#[serde(
rename = "suspendedAt",
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,
}
pub mod error {
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())
}
}
}
}
#[derive(Clone, Debug)]
pub struct Client {
pub(crate) baseurl: String,
pub(crate) client: reqwest::Client,
}
impl Client {
pub fn new(baseurl: &str) -> Result<Self, reqwest::Error> {
#[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();
Ok(Self::new_with_client(baseurl, client.build()?))
}
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 {
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(&QueryParam::new("limit", &limit))
.query(&QueryParam::new("page", &page))
.query(&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)),
}
}
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(&QueryParam::new("identity", &identity))
.query(&QueryParam::new("identityType", &identity_type))
.query(&QueryParam::new("key", &key))
.query(&QueryParam::new("limit", &limit))
.query(&QueryParam::new("page", &page))
.query(&QueryParam::new("platform", &platform))
.query(&QueryParam::new("skip", &skip))
.query(&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)),
}
}
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)),
}
}
}