#![allow(unused_imports, unused_qualifications, unused_extern_crates)]
use serde::de::{DeserializeOwned, Deserializer};
use serde::ser::Serializer;
use serde::Deserialize;
use serde_json::value::Value;
use std::cmp::Eq;
use std::collections::HashMap;
use std::default::Default;
use std::fmt::{self, Display, Formatter};
use std::hash::Hash;
use chrono::DateTime;
use chrono::offset::FixedOffset;
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
pub struct UpdateConnection {
pub slack_connection: SlackConnection,
}
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
pub struct Error {
pub error: ErrorError,
}
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
pub struct ErrorError {
#[serde(skip_serializing_if = "String::is_empty")]
pub message: String,
}
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
pub struct Pagination {
pub offset: isize,
pub limit: u8,
pub more: bool,
pub total: isize,
}
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
pub struct SlackConnection {
pub id: Option<String>,
pub source_id: Option<String>,
pub source_name: Option<String>,
pub source_type: Option<SlackConnectionSourceType>,
pub channel_id: Option<String>,
pub channel_name: Option<String>,
pub notification_type: Option<SlackConnectionNotifiationType>,
pub config: Option<SlackConnectionConfig>,
}
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
pub struct SlackConnectionConfig {
pub events: Option<SlackConnectionEvents>,
pub urgency: Option<SlackConnectionUrgency>,
pub priorities: Option<SlackConnectionPriorities>,
}
pub type SlackConnectionEvents = Vec<String>;
#[allow(non_camel_case_types)]
#[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum SlackConnectionNotifiationType {
#[serde(rename = "responder")]
RESPONDER,
#[serde(rename = "stakeholder")]
STAKEHOLDER,
}
impl Display for SlackConnectionNotifiationType {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
match *self {
SlackConnectionNotifiationType::RESPONDER => write!(f, "responder"),
SlackConnectionNotifiationType::STAKEHOLDER => write!(f, "stakeholder"),
}
}
}
impl std::str::FromStr for SlackConnectionNotifiationType {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"responder" => Ok(SlackConnectionNotifiationType::RESPONDER),
"stakeholder" => Ok(SlackConnectionNotifiationType::STAKEHOLDER),
_ => Err(()),
}
}
}
pub type SlackConnectionPriorities = Vec<String>;
#[allow(non_camel_case_types)]
#[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum SlackConnectionSourceType {
#[serde(rename = "service_reference")]
SERVICE_REFERENCE,
#[serde(rename = "team_reference")]
TEAM_REFERENCE,
}
impl Display for SlackConnectionSourceType {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
match *self {
SlackConnectionSourceType::SERVICE_REFERENCE => write!(f, "service_reference"),
SlackConnectionSourceType::TEAM_REFERENCE => write!(f, "team_reference"),
}
}
}
impl std::str::FromStr for SlackConnectionSourceType {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"service_reference" => Ok(SlackConnectionSourceType::SERVICE_REFERENCE),
"team_reference" => Ok(SlackConnectionSourceType::TEAM_REFERENCE),
_ => Err(()),
}
}
}
#[allow(non_camel_case_types)]
#[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum SlackConnectionUrgency {
#[serde(rename = "high")]
HIGH,
#[serde(rename = "low")]
LOW,
#[serde(rename = "null")]
NULL,
}
impl Display for SlackConnectionUrgency {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
match *self {
SlackConnectionUrgency::HIGH => write!(f, "high"),
SlackConnectionUrgency::LOW => write!(f, "low"),
SlackConnectionUrgency::NULL => write!(f, "null"),
}
}
}
impl std::str::FromStr for SlackConnectionUrgency {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"high" => Ok(SlackConnectionUrgency::HIGH),
"low" => Ok(SlackConnectionUrgency::LOW),
"null" => Ok(SlackConnectionUrgency::NULL),
_ => Err(()),
}
}
}
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
pub struct CreateConnection {
pub slack_connection: SlackConnection,
}