airbyte_client/models/
connection_read.rs

1/*
2 * Airbyte Configuration API
3 *
4 * Airbyte Configuration API [https://airbyte.io](https://airbyte.io).  The Configuration API is an internal Airbyte API that is designed for communications between different Airbyte components. * Its main purpose is to enable the Airbyte Engineering team to configure the internal state of [Airbyte Cloud](https://airbyte.com/airbyte-cloud) * It is also sometimes used by OSS users to configure their own Self-Hosted Airbyte deployment (internal state, etc)  WARNING * Airbyte does NOT have active commitments to support this API long-term. * OSS users can utilize the Configuration API, but at their own risk. * This API is utilized internally by the Airbyte Engineering team and may be modified in the future if the need arises. * Modifications by the Airbyte Engineering team could create breaking changes and OSS users would need to update their code to catch up to any backwards incompatible changes in the API.  This API is a collection of HTTP RPC-style methods. While it is not a REST API, those familiar with REST should find the conventions of this API recognizable.  Here are some conventions that this API follows: * All endpoints are http POST methods. * All endpoints accept data via `application/json` request bodies. The API does not accept any data via query params. * The naming convention for endpoints is: localhost:8000/api/{VERSION}/{METHOD_FAMILY}/{METHOD_NAME} e.g. `localhost:8000/api/v1/connections/create`. * For all `update` methods, the whole object must be passed in, even the fields that did not change.  Authentication (OSS): * When authenticating to the Configuration API, you must use Basic Authentication by setting the Authentication Header to Basic and base64 encoding the username and password (which are `airbyte` and `password` by default - so base64 encoding `airbyte:password` results in `YWlyYnl0ZTpwYXNzd29yZA==`). So the full header reads `'Authorization': \"Basic YWlyYnl0ZTpwYXNzd29yZA==\"`
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * Contact: contact@airbyte.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
12pub struct ConnectionRead {
13    #[serde(rename = "connectionId")]
14    pub connection_id: uuid::Uuid,
15    #[serde(rename = "name")]
16    pub name: String,
17    #[serde(
18        rename = "namespaceDefinition",
19        skip_serializing_if = "Option::is_none"
20    )]
21    pub namespace_definition: Option<crate::models::NamespaceDefinitionType>,
22    /// Used when namespaceDefinition is 'customformat'. If blank then behaves like namespaceDefinition = 'destination'. If \"${SOURCE_NAMESPACE}\" then behaves like namespaceDefinition = 'source'.
23    #[serde(rename = "namespaceFormat", skip_serializing_if = "Option::is_none")]
24    pub namespace_format: Option<String>,
25    /// Prefix that will be prepended to the name of each stream when it is written to the destination.
26    #[serde(rename = "prefix", skip_serializing_if = "Option::is_none")]
27    pub prefix: Option<String>,
28    #[serde(rename = "sourceId")]
29    pub source_id: uuid::Uuid,
30    #[serde(rename = "destinationId")]
31    pub destination_id: uuid::Uuid,
32    #[serde(rename = "operationIds", skip_serializing_if = "Option::is_none")]
33    pub operation_ids: Option<Vec<uuid::Uuid>>,
34    #[serde(rename = "syncCatalog")]
35    pub sync_catalog: Box<crate::models::AirbyteCatalog>,
36    #[serde(rename = "schedule", skip_serializing_if = "Option::is_none")]
37    pub schedule: Option<Box<crate::models::ConnectionSchedule>>,
38    #[serde(rename = "scheduleType", skip_serializing_if = "Option::is_none")]
39    pub schedule_type: Option<crate::models::ConnectionScheduleType>,
40    #[serde(rename = "scheduleData", skip_serializing_if = "Option::is_none")]
41    pub schedule_data: Option<Box<crate::models::ConnectionScheduleData>>,
42    #[serde(rename = "status")]
43    pub status: crate::models::ConnectionStatus,
44    #[serde(
45        rename = "resourceRequirements",
46        skip_serializing_if = "Option::is_none"
47    )]
48    pub resource_requirements: Option<Box<crate::models::ResourceRequirements>>,
49    #[serde(rename = "sourceCatalogId", skip_serializing_if = "Option::is_none")]
50    pub source_catalog_id: Option<uuid::Uuid>,
51    #[serde(rename = "geography", skip_serializing_if = "Option::is_none")]
52    pub geography: Option<crate::models::Geography>,
53    #[serde(rename = "breakingChange")]
54    pub breaking_change: bool,
55    #[serde(
56        rename = "notifySchemaChanges",
57        skip_serializing_if = "Option::is_none"
58    )]
59    pub notify_schema_changes: Option<bool>,
60    #[serde(
61        rename = "notifySchemaChangesByEmail",
62        skip_serializing_if = "Option::is_none"
63    )]
64    pub notify_schema_changes_by_email: Option<bool>,
65    #[serde(
66        rename = "nonBreakingChangesPreference",
67        skip_serializing_if = "Option::is_none"
68    )]
69    pub non_breaking_changes_preference: Option<crate::models::NonBreakingChangesPreference>,
70    #[serde(rename = "workspaceId", skip_serializing_if = "Option::is_none")]
71    pub workspace_id: Option<uuid::Uuid>,
72}
73
74impl ConnectionRead {
75    pub fn new(
76        connection_id: uuid::Uuid,
77        name: String,
78        source_id: uuid::Uuid,
79        destination_id: uuid::Uuid,
80        sync_catalog: crate::models::AirbyteCatalog,
81        status: crate::models::ConnectionStatus,
82        breaking_change: bool,
83    ) -> ConnectionRead {
84        ConnectionRead {
85            connection_id,
86            name,
87            namespace_definition: None,
88            namespace_format: None,
89            prefix: None,
90            source_id,
91            destination_id,
92            operation_ids: None,
93            sync_catalog: Box::new(sync_catalog),
94            schedule: None,
95            schedule_type: None,
96            schedule_data: None,
97            status,
98            resource_requirements: None,
99            source_catalog_id: None,
100            geography: None,
101            breaking_change,
102            notify_schema_changes: None,
103            notify_schema_changes_by_email: None,
104            non_breaking_changes_preference: None,
105            workspace_id: None,
106        }
107    }
108}