/
model_airbyte_stream.go
330 lines (277 loc) · 11.1 KB
/
model_airbyte_stream.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
/*
Airbyte Configuration API
Airbyte Configuration API [https://airbyte.io](https://airbyte.io). 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/{VERSION}/{METHOD_FAMILY}/{METHOD_NAME} e.g. `localhost:8000/v1/connections/create`. * For all `update` methods, the whole object must be passed in, even the fields that did not change. Change Management: * The major version of the API endpoint can be determined / specified in the URL `localhost:8080/v1/connections/create` * Minor version bumps will be invisible to the end user. The user cannot specify minor versions in requests. * All backwards incompatible changes will happen in major version bumps. We will not make backwards incompatible changes in minor version bumps. Examples of non-breaking changes (includes but not limited to...): * Adding fields to request or response bodies. * Adding new HTTP endpoints. * All `web_backend` APIs are not considered public APIs and are not guaranteeing backwards compatibility.
API version: 1.0.0
Contact: contact@airbyte.io
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package airbyte
import (
"encoding/json"
)
// AirbyteStream the immutable schema defined by the source
type AirbyteStream struct {
// Stream's name.
Name string `json:"name"`
JsonSchema map[string]interface{} `json:"jsonSchema,omitempty"`
SupportedSyncModes []SyncMode `json:"supportedSyncModes,omitempty"`
// If the source defines the cursor field, then any other cursor field inputs will be ignored. If it does not, either the user_provided one is used, or the default one is used as a backup.
SourceDefinedCursor *bool `json:"sourceDefinedCursor,omitempty"`
// Path to the field that will be used to determine if a record is new or modified since the last sync. If not provided by the source, the end user will have to specify the comparable themselves.
DefaultCursorField []string `json:"defaultCursorField,omitempty"`
// If the source defines the primary key, paths to the fields that will be used as a primary key. If not provided by the source, the end user will have to specify the primary key themselves.
SourceDefinedPrimaryKey [][]string `json:"sourceDefinedPrimaryKey,omitempty"`
// Optional Source-defined namespace. Airbyte streams from the same sources should have the same namespace. Currently only used by JDBC destinations to determine what schema to write to.
Namespace *string `json:"namespace,omitempty"`
}
// NewAirbyteStream instantiates a new AirbyteStream object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewAirbyteStream(name string) *AirbyteStream {
this := AirbyteStream{}
this.Name = name
return &this
}
// NewAirbyteStreamWithDefaults instantiates a new AirbyteStream object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewAirbyteStreamWithDefaults() *AirbyteStream {
this := AirbyteStream{}
return &this
}
// GetName returns the Name field value
func (o *AirbyteStream) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *AirbyteStream) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *AirbyteStream) SetName(v string) {
o.Name = v
}
// GetJsonSchema returns the JsonSchema field value if set, zero value otherwise.
func (o *AirbyteStream) GetJsonSchema() map[string]interface{} {
if o == nil || o.JsonSchema == nil {
var ret map[string]interface{}
return ret
}
return o.JsonSchema
}
// GetJsonSchemaOk returns a tuple with the JsonSchema field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AirbyteStream) GetJsonSchemaOk() (map[string]interface{}, bool) {
if o == nil || o.JsonSchema == nil {
return nil, false
}
return o.JsonSchema, true
}
// HasJsonSchema returns a boolean if a field has been set.
func (o *AirbyteStream) HasJsonSchema() bool {
if o != nil && o.JsonSchema != nil {
return true
}
return false
}
// SetJsonSchema gets a reference to the given map[string]interface{} and assigns it to the JsonSchema field.
func (o *AirbyteStream) SetJsonSchema(v map[string]interface{}) {
o.JsonSchema = v
}
// GetSupportedSyncModes returns the SupportedSyncModes field value if set, zero value otherwise.
func (o *AirbyteStream) GetSupportedSyncModes() []SyncMode {
if o == nil || o.SupportedSyncModes == nil {
var ret []SyncMode
return ret
}
return o.SupportedSyncModes
}
// GetSupportedSyncModesOk returns a tuple with the SupportedSyncModes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AirbyteStream) GetSupportedSyncModesOk() ([]SyncMode, bool) {
if o == nil || o.SupportedSyncModes == nil {
return nil, false
}
return o.SupportedSyncModes, true
}
// HasSupportedSyncModes returns a boolean if a field has been set.
func (o *AirbyteStream) HasSupportedSyncModes() bool {
if o != nil && o.SupportedSyncModes != nil {
return true
}
return false
}
// SetSupportedSyncModes gets a reference to the given []SyncMode and assigns it to the SupportedSyncModes field.
func (o *AirbyteStream) SetSupportedSyncModes(v []SyncMode) {
o.SupportedSyncModes = v
}
// GetSourceDefinedCursor returns the SourceDefinedCursor field value if set, zero value otherwise.
func (o *AirbyteStream) GetSourceDefinedCursor() bool {
if o == nil || o.SourceDefinedCursor == nil {
var ret bool
return ret
}
return *o.SourceDefinedCursor
}
// GetSourceDefinedCursorOk returns a tuple with the SourceDefinedCursor field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AirbyteStream) GetSourceDefinedCursorOk() (*bool, bool) {
if o == nil || o.SourceDefinedCursor == nil {
return nil, false
}
return o.SourceDefinedCursor, true
}
// HasSourceDefinedCursor returns a boolean if a field has been set.
func (o *AirbyteStream) HasSourceDefinedCursor() bool {
if o != nil && o.SourceDefinedCursor != nil {
return true
}
return false
}
// SetSourceDefinedCursor gets a reference to the given bool and assigns it to the SourceDefinedCursor field.
func (o *AirbyteStream) SetSourceDefinedCursor(v bool) {
o.SourceDefinedCursor = &v
}
// GetDefaultCursorField returns the DefaultCursorField field value if set, zero value otherwise.
func (o *AirbyteStream) GetDefaultCursorField() []string {
if o == nil || o.DefaultCursorField == nil {
var ret []string
return ret
}
return o.DefaultCursorField
}
// GetDefaultCursorFieldOk returns a tuple with the DefaultCursorField field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AirbyteStream) GetDefaultCursorFieldOk() ([]string, bool) {
if o == nil || o.DefaultCursorField == nil {
return nil, false
}
return o.DefaultCursorField, true
}
// HasDefaultCursorField returns a boolean if a field has been set.
func (o *AirbyteStream) HasDefaultCursorField() bool {
if o != nil && o.DefaultCursorField != nil {
return true
}
return false
}
// SetDefaultCursorField gets a reference to the given []string and assigns it to the DefaultCursorField field.
func (o *AirbyteStream) SetDefaultCursorField(v []string) {
o.DefaultCursorField = v
}
// GetSourceDefinedPrimaryKey returns the SourceDefinedPrimaryKey field value if set, zero value otherwise.
func (o *AirbyteStream) GetSourceDefinedPrimaryKey() [][]string {
if o == nil || o.SourceDefinedPrimaryKey == nil {
var ret [][]string
return ret
}
return o.SourceDefinedPrimaryKey
}
// GetSourceDefinedPrimaryKeyOk returns a tuple with the SourceDefinedPrimaryKey field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AirbyteStream) GetSourceDefinedPrimaryKeyOk() ([][]string, bool) {
if o == nil || o.SourceDefinedPrimaryKey == nil {
return nil, false
}
return o.SourceDefinedPrimaryKey, true
}
// HasSourceDefinedPrimaryKey returns a boolean if a field has been set.
func (o *AirbyteStream) HasSourceDefinedPrimaryKey() bool {
if o != nil && o.SourceDefinedPrimaryKey != nil {
return true
}
return false
}
// SetSourceDefinedPrimaryKey gets a reference to the given [][]string and assigns it to the SourceDefinedPrimaryKey field.
func (o *AirbyteStream) SetSourceDefinedPrimaryKey(v [][]string) {
o.SourceDefinedPrimaryKey = v
}
// GetNamespace returns the Namespace field value if set, zero value otherwise.
func (o *AirbyteStream) GetNamespace() string {
if o == nil || o.Namespace == nil {
var ret string
return ret
}
return *o.Namespace
}
// GetNamespaceOk returns a tuple with the Namespace field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AirbyteStream) GetNamespaceOk() (*string, bool) {
if o == nil || o.Namespace == nil {
return nil, false
}
return o.Namespace, true
}
// HasNamespace returns a boolean if a field has been set.
func (o *AirbyteStream) HasNamespace() bool {
if o != nil && o.Namespace != nil {
return true
}
return false
}
// SetNamespace gets a reference to the given string and assigns it to the Namespace field.
func (o *AirbyteStream) SetNamespace(v string) {
o.Namespace = &v
}
func (o AirbyteStream) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["name"] = o.Name
}
if o.JsonSchema != nil {
toSerialize["jsonSchema"] = o.JsonSchema
}
if o.SupportedSyncModes != nil {
toSerialize["supportedSyncModes"] = o.SupportedSyncModes
}
if o.SourceDefinedCursor != nil {
toSerialize["sourceDefinedCursor"] = o.SourceDefinedCursor
}
if o.DefaultCursorField != nil {
toSerialize["defaultCursorField"] = o.DefaultCursorField
}
if o.SourceDefinedPrimaryKey != nil {
toSerialize["sourceDefinedPrimaryKey"] = o.SourceDefinedPrimaryKey
}
if o.Namespace != nil {
toSerialize["namespace"] = o.Namespace
}
return json.Marshal(toSerialize)
}
type NullableAirbyteStream struct {
value *AirbyteStream
isSet bool
}
func (v NullableAirbyteStream) Get() *AirbyteStream {
return v.value
}
func (v *NullableAirbyteStream) Set(val *AirbyteStream) {
v.value = val
v.isSet = true
}
func (v NullableAirbyteStream) IsSet() bool {
return v.isSet
}
func (v *NullableAirbyteStream) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAirbyteStream(val *AirbyteStream) *NullableAirbyteStream {
return &NullableAirbyteStream{value: val, isSet: true}
}
func (v NullableAirbyteStream) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAirbyteStream) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}