Skip to content

Commit 1c2b795

Browse files
authored
rust: Regenerate model files (#1697)
Follow-up to #1695, last prep PR for including the new openapi-codegen in CI.
2 parents 3cee9f0 + 0932f59 commit 1c2b795

12 files changed

+46
-43
lines changed

rust/src/models/background_task_out.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// this file is @generated (with minor manual edits)
1+
// this file is @generated
22
use serde::{Deserialize, Serialize};
33

44
use super::{

rust/src/models/template_in.rs renamed to rust/src/models/connector_in.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// this file is @generated
22
use serde::{Deserialize, Serialize};
33

4-
use super::transformation_template_kind::TransformationTemplateKind;
4+
use super::connector_kind::ConnectorKind;
55

66
#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7-
pub struct TemplateIn {
7+
pub struct ConnectorIn {
88
#[serde(skip_serializing_if = "Option::is_none")]
99
pub description: Option<String>,
1010

@@ -24,7 +24,7 @@ pub struct TemplateIn {
2424
pub instructions_link: Option<String>,
2525

2626
#[serde(skip_serializing_if = "Option::is_none")]
27-
pub kind: Option<TransformationTemplateKind>,
27+
pub kind: Option<ConnectorKind>,
2828

2929
pub logo: String,
3030

@@ -33,7 +33,7 @@ pub struct TemplateIn {
3333
pub transformation: String,
3434
}
3535

36-
impl TemplateIn {
36+
impl ConnectorIn {
3737
pub fn new(logo: String, name: String, transformation: String) -> Self {
3838
Self {
3939
description: None,

rust/src/models/transformation_template_kind.rs renamed to rust/src/models/connector_kind.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize};
66
#[derive(
77
Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize,
88
)]
9-
pub enum TransformationTemplateKind {
9+
pub enum ConnectorKind {
1010
#[default]
1111
#[serde(rename = "Custom")]
1212
Custom,
@@ -34,7 +34,7 @@ pub enum TransformationTemplateKind {
3434
Zapier,
3535
}
3636

37-
impl fmt::Display for TransformationTemplateKind {
37+
impl fmt::Display for ConnectorKind {
3838
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3939
let value = match self {
4040
Self::Custom => "Custom",

rust/src/models/environment_in.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
// this file is @generated
22
use serde::{Deserialize, Serialize};
33

4-
use super::{event_type_in::EventTypeIn, template_in::TemplateIn};
4+
use super::{connector_in::ConnectorIn, event_type_in::EventTypeIn};
55

66
#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
77
pub struct EnvironmentIn {
8+
#[serde(skip_serializing_if = "Option::is_none")]
9+
pub connectors: Option<Vec<ConnectorIn>>,
10+
811
#[serde(rename = "eventTypes")]
912
#[serde(skip_serializing_if = "Option::is_none")]
1013
pub event_types: Option<Vec<EventTypeIn>>,
1114

1215
#[serde(skip_serializing_if = "Option::is_none")]
1316
pub settings: Option<serde_json::Value>,
14-
15-
#[serde(rename = "transformationTemplates")]
16-
#[serde(skip_serializing_if = "Option::is_none")]
17-
pub transformation_templates: Option<Vec<TemplateIn>>,
1817
}
1918

2019
impl EnvironmentIn {
2120
pub fn new() -> Self {
2221
Self {
22+
connectors: None,
2323
event_types: None,
2424
settings: None,
25-
transformation_templates: None,
2625
}
2726
}
2827
}

rust/src/models/integration_in.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@ use serde::{Deserialize, Serialize};
33

44
#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
55
pub struct IntegrationIn {
6+
/// The set of feature flags the integration will have access to.
7+
#[serde(rename = "featureFlags")]
8+
#[serde(skip_serializing_if = "Option::is_none")]
9+
pub feature_flags: Option<Vec<String>>,
10+
611
pub name: String,
712
}
813

914
impl IntegrationIn {
1015
pub fn new(name: String) -> Self {
11-
Self { name }
16+
Self {
17+
feature_flags: None,
18+
name,
19+
}
1220
}
1321
}

rust/src/models/integration_out.rs

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ pub struct IntegrationOut {
66
#[serde(rename = "createdAt")]
77
pub created_at: String,
88

9+
/// The set of feature flags the integration has access to.
10+
#[serde(rename = "featureFlags")]
11+
#[serde(skip_serializing_if = "Option::is_none")]
12+
pub feature_flags: Option<Vec<String>>,
13+
914
/// The integ's ID
1015
pub id: String,
1116

@@ -19,6 +24,7 @@ impl IntegrationOut {
1924
pub fn new(created_at: String, id: String, name: String, updated_at: String) -> Self {
2025
Self {
2126
created_at,
27+
feature_flags: None,
2228
id,
2329
name,
2430
updated_at,

rust/src/models/integration_update.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@ use serde::{Deserialize, Serialize};
33

44
#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
55
pub struct IntegrationUpdate {
6+
/// The set of feature flags the integration will have access to.
7+
#[serde(rename = "featureFlags")]
8+
#[serde(skip_serializing_if = "Option::is_none")]
9+
pub feature_flags: Option<Vec<String>>,
10+
611
pub name: String,
712
}
813

914
impl IntegrationUpdate {
1015
pub fn new(name: String) -> Self {
11-
Self { name }
16+
Self {
17+
feature_flags: None,
18+
name,
19+
}
1220
}
1321
}

rust/src/models/message_attempt_trigger_type.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ pub enum MessageAttemptTriggerType {
2828

2929
impl fmt::Display for MessageAttemptTriggerType {
3030
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
31-
let value = match self {
32-
Self::Scheduled => "0",
33-
Self::Manual => "1",
34-
};
35-
f.write_str(value)
31+
write!(f, "{}", *self as i64)
3632
}
3733
}

rust/src/models/message_status.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ pub enum MessageStatus {
3232

3333
impl fmt::Display for MessageStatus {
3434
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
35-
let value = match self {
36-
Self::Success => "0",
37-
Self::Pending => "1",
38-
Self::Fail => "2",
39-
Self::Sending => "3",
40-
};
41-
f.write_str(value)
35+
write!(f, "{}", *self as i64)
4236
}
4337
}

rust/src/models/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ pub mod application_token_expire_in;
1212
pub mod background_task_out;
1313
pub mod background_task_status;
1414
pub mod background_task_type;
15+
pub mod connector_in;
16+
pub mod connector_kind;
1517
pub mod dashboard_access_out;
1618
pub mod endpoint_headers_in;
1719
pub mod endpoint_headers_out;
@@ -75,9 +77,7 @@ pub mod recover_out;
7577
pub mod replay_in;
7678
pub mod replay_out;
7779
pub mod status_code_class;
78-
pub mod template_in;
7980
pub mod template_out;
80-
pub mod transformation_template_kind;
8181
pub mod validation_error;
8282

8383
#[rustfmt::skip]
@@ -94,6 +94,8 @@ pub use self::{
9494
background_task_out::BackgroundTaskOut,
9595
background_task_status::BackgroundTaskStatus,
9696
background_task_type::BackgroundTaskType,
97+
connector_in::ConnectorIn,
98+
connector_kind::ConnectorKind,
9799
dashboard_access_out::DashboardAccessOut,
98100
endpoint_headers_in::EndpointHeadersIn,
99101
endpoint_headers_out::EndpointHeadersOut,
@@ -157,8 +159,6 @@ pub use self::{
157159
replay_in::ReplayIn,
158160
replay_out::ReplayOut,
159161
status_code_class::StatusCodeClass,
160-
template_in::TemplateIn,
161162
template_out::TemplateOut,
162-
transformation_template_kind::TransformationTemplateKind,
163163
validation_error::ValidationError,
164164
};

rust/src/models/status_code_class.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,6 @@ pub enum StatusCodeClass {
3636

3737
impl fmt::Display for StatusCodeClass {
3838
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
39-
let value = match self {
40-
Self::CodeNone => "0",
41-
Self::Code1xx => "100",
42-
Self::Code2xx => "200",
43-
Self::Code3xx => "300",
44-
Self::Code4xx => "400",
45-
Self::Code5xx => "500",
46-
};
47-
f.write_str(value)
39+
write!(f, "{}", *self as i64)
4840
}
4941
}

rust/src/models/template_out.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// this file is @generated
22
use serde::{Deserialize, Serialize};
33

4-
use super::transformation_template_kind::TransformationTemplateKind;
4+
use super::connector_kind::ConnectorKind;
55

66
#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
77
pub struct TemplateOut {
@@ -26,7 +26,7 @@ pub struct TemplateOut {
2626
#[serde(skip_serializing_if = "Option::is_none")]
2727
pub instructions_link: Option<String>,
2828

29-
pub kind: TransformationTemplateKind,
29+
pub kind: ConnectorKind,
3030

3131
pub logo: String,
3232

@@ -47,7 +47,7 @@ impl TemplateOut {
4747
description: String,
4848
id: String,
4949
instructions: String,
50-
kind: TransformationTemplateKind,
50+
kind: ConnectorKind,
5151
logo: String,
5252
name: String,
5353
org_id: String,

0 commit comments

Comments
 (0)