-
Notifications
You must be signed in to change notification settings - Fork 14
/
sourceoracleupdate.go
770 lines (635 loc) · 23 KB
/
sourceoracleupdate.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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
package shared
import (
"encoding/json"
"errors"
"fmt"
"github.com/airbytehq/terraform-provider-airbyte/internal/sdk/pkg/utils"
)
type SourceOracleUpdateConnectionType string
const (
SourceOracleUpdateConnectionTypeSid SourceOracleUpdateConnectionType = "sid"
)
func (e SourceOracleUpdateConnectionType) ToPointer() *SourceOracleUpdateConnectionType {
return &e
}
func (e *SourceOracleUpdateConnectionType) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "sid":
*e = SourceOracleUpdateConnectionType(v)
return nil
default:
return fmt.Errorf("invalid value for SourceOracleUpdateConnectionType: %v", v)
}
}
// SystemIDSID - Use SID (Oracle System Identifier)
type SystemIDSID struct {
connectionType *SourceOracleUpdateConnectionType `const:"sid" json:"connection_type,omitempty"`
Sid string `json:"sid"`
}
func (s SystemIDSID) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(s, "", false)
}
func (s *SystemIDSID) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &s, "", false, true); err != nil {
return err
}
return nil
}
func (o *SystemIDSID) GetConnectionType() *SourceOracleUpdateConnectionType {
return SourceOracleUpdateConnectionTypeSid.ToPointer()
}
func (o *SystemIDSID) GetSid() string {
if o == nil {
return ""
}
return o.Sid
}
type ConnectionType string
const (
ConnectionTypeServiceName ConnectionType = "service_name"
)
func (e ConnectionType) ToPointer() *ConnectionType {
return &e
}
func (e *ConnectionType) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "service_name":
*e = ConnectionType(v)
return nil
default:
return fmt.Errorf("invalid value for ConnectionType: %v", v)
}
}
// ServiceName - Use service name
type ServiceName struct {
connectionType *ConnectionType `const:"service_name" json:"connection_type,omitempty"`
ServiceName string `json:"service_name"`
}
func (s ServiceName) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(s, "", false)
}
func (s *ServiceName) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &s, "", false, true); err != nil {
return err
}
return nil
}
func (o *ServiceName) GetConnectionType() *ConnectionType {
return ConnectionTypeServiceName.ToPointer()
}
func (o *ServiceName) GetServiceName() string {
if o == nil {
return ""
}
return o.ServiceName
}
type ConnectByType string
const (
ConnectByTypeServiceName ConnectByType = "Service name"
ConnectByTypeSystemIDSID ConnectByType = "System ID (SID)"
)
// ConnectBy - Connect data that will be used for DB connection
type ConnectBy struct {
ServiceName *ServiceName
SystemIDSID *SystemIDSID
Type ConnectByType
}
func CreateConnectByServiceName(serviceName ServiceName) ConnectBy {
typ := ConnectByTypeServiceName
return ConnectBy{
ServiceName: &serviceName,
Type: typ,
}
}
func CreateConnectBySystemIDSID(systemIDSID SystemIDSID) ConnectBy {
typ := ConnectByTypeSystemIDSID
return ConnectBy{
SystemIDSID: &systemIDSID,
Type: typ,
}
}
func (u *ConnectBy) UnmarshalJSON(data []byte) error {
serviceName := new(ServiceName)
if err := utils.UnmarshalJSON(data, &serviceName, "", true, true); err == nil {
u.ServiceName = serviceName
u.Type = ConnectByTypeServiceName
return nil
}
systemIDSID := new(SystemIDSID)
if err := utils.UnmarshalJSON(data, &systemIDSID, "", true, true); err == nil {
u.SystemIDSID = systemIDSID
u.Type = ConnectByTypeSystemIDSID
return nil
}
return errors.New("could not unmarshal into supported union types")
}
func (u ConnectBy) MarshalJSON() ([]byte, error) {
if u.ServiceName != nil {
return utils.MarshalJSON(u.ServiceName, "", true)
}
if u.SystemIDSID != nil {
return utils.MarshalJSON(u.SystemIDSID, "", true)
}
return nil, errors.New("could not marshal union type: all fields are null")
}
type SourceOracleUpdateEncryptionMethod string
const (
SourceOracleUpdateEncryptionMethodEncryptedVerifyCertificate SourceOracleUpdateEncryptionMethod = "encrypted_verify_certificate"
)
func (e SourceOracleUpdateEncryptionMethod) ToPointer() *SourceOracleUpdateEncryptionMethod {
return &e
}
func (e *SourceOracleUpdateEncryptionMethod) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "encrypted_verify_certificate":
*e = SourceOracleUpdateEncryptionMethod(v)
return nil
default:
return fmt.Errorf("invalid value for SourceOracleUpdateEncryptionMethod: %v", v)
}
}
// TLSEncryptedVerifyCertificate - Verify and use the certificate provided by the server.
type TLSEncryptedVerifyCertificate struct {
encryptionMethod SourceOracleUpdateEncryptionMethod `const:"encrypted_verify_certificate" json:"encryption_method"`
// Privacy Enhanced Mail (PEM) files are concatenated certificate containers frequently used in certificate installations.
SslCertificate string `json:"ssl_certificate"`
}
func (t TLSEncryptedVerifyCertificate) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(t, "", false)
}
func (t *TLSEncryptedVerifyCertificate) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &t, "", false, true); err != nil {
return err
}
return nil
}
func (o *TLSEncryptedVerifyCertificate) GetEncryptionMethod() SourceOracleUpdateEncryptionMethod {
return SourceOracleUpdateEncryptionMethodEncryptedVerifyCertificate
}
func (o *TLSEncryptedVerifyCertificate) GetSslCertificate() string {
if o == nil {
return ""
}
return o.SslCertificate
}
// EncryptionAlgorithm - This parameter defines what encryption algorithm is used.
type EncryptionAlgorithm string
const (
EncryptionAlgorithmAes256 EncryptionAlgorithm = "AES256"
EncryptionAlgorithmRc456 EncryptionAlgorithm = "RC4_56"
EncryptionAlgorithmThreeDes168 EncryptionAlgorithm = "3DES168"
)
func (e EncryptionAlgorithm) ToPointer() *EncryptionAlgorithm {
return &e
}
func (e *EncryptionAlgorithm) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "AES256":
fallthrough
case "RC4_56":
fallthrough
case "3DES168":
*e = EncryptionAlgorithm(v)
return nil
default:
return fmt.Errorf("invalid value for EncryptionAlgorithm: %v", v)
}
}
type EncryptionMethod string
const (
EncryptionMethodClientNne EncryptionMethod = "client_nne"
)
func (e EncryptionMethod) ToPointer() *EncryptionMethod {
return &e
}
func (e *EncryptionMethod) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "client_nne":
*e = EncryptionMethod(v)
return nil
default:
return fmt.Errorf("invalid value for EncryptionMethod: %v", v)
}
}
// NativeNetworkEncryptionNNE - The native network encryption gives you the ability to encrypt database connections, without the configuration overhead of TCP/IP and SSL/TLS and without the need to open and listen on different ports.
type NativeNetworkEncryptionNNE struct {
// This parameter defines what encryption algorithm is used.
EncryptionAlgorithm *EncryptionAlgorithm `default:"AES256" json:"encryption_algorithm"`
encryptionMethod EncryptionMethod `const:"client_nne" json:"encryption_method"`
}
func (n NativeNetworkEncryptionNNE) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(n, "", false)
}
func (n *NativeNetworkEncryptionNNE) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &n, "", false, true); err != nil {
return err
}
return nil
}
func (o *NativeNetworkEncryptionNNE) GetEncryptionAlgorithm() *EncryptionAlgorithm {
if o == nil {
return nil
}
return o.EncryptionAlgorithm
}
func (o *NativeNetworkEncryptionNNE) GetEncryptionMethod() EncryptionMethod {
return EncryptionMethodClientNne
}
type EncryptionUnionType string
const (
EncryptionUnionTypeNativeNetworkEncryptionNNE EncryptionUnionType = "Native Network Encryption (NNE)"
EncryptionUnionTypeTLSEncryptedVerifyCertificate EncryptionUnionType = "TLS Encrypted (verify certificate)"
)
// Encryption - The encryption method with is used when communicating with the database.
type Encryption struct {
NativeNetworkEncryptionNNE *NativeNetworkEncryptionNNE
TLSEncryptedVerifyCertificate *TLSEncryptedVerifyCertificate
Type EncryptionUnionType
}
func CreateEncryptionNativeNetworkEncryptionNNE(nativeNetworkEncryptionNNE NativeNetworkEncryptionNNE) Encryption {
typ := EncryptionUnionTypeNativeNetworkEncryptionNNE
return Encryption{
NativeNetworkEncryptionNNE: &nativeNetworkEncryptionNNE,
Type: typ,
}
}
func CreateEncryptionTLSEncryptedVerifyCertificate(tlsEncryptedVerifyCertificate TLSEncryptedVerifyCertificate) Encryption {
typ := EncryptionUnionTypeTLSEncryptedVerifyCertificate
return Encryption{
TLSEncryptedVerifyCertificate: &tlsEncryptedVerifyCertificate,
Type: typ,
}
}
func (u *Encryption) UnmarshalJSON(data []byte) error {
nativeNetworkEncryptionNNE := new(NativeNetworkEncryptionNNE)
if err := utils.UnmarshalJSON(data, &nativeNetworkEncryptionNNE, "", true, true); err == nil {
u.NativeNetworkEncryptionNNE = nativeNetworkEncryptionNNE
u.Type = EncryptionUnionTypeNativeNetworkEncryptionNNE
return nil
}
tlsEncryptedVerifyCertificate := new(TLSEncryptedVerifyCertificate)
if err := utils.UnmarshalJSON(data, &tlsEncryptedVerifyCertificate, "", true, true); err == nil {
u.TLSEncryptedVerifyCertificate = tlsEncryptedVerifyCertificate
u.Type = EncryptionUnionTypeTLSEncryptedVerifyCertificate
return nil
}
return errors.New("could not unmarshal into supported union types")
}
func (u Encryption) MarshalJSON() ([]byte, error) {
if u.NativeNetworkEncryptionNNE != nil {
return utils.MarshalJSON(u.NativeNetworkEncryptionNNE, "", true)
}
if u.TLSEncryptedVerifyCertificate != nil {
return utils.MarshalJSON(u.TLSEncryptedVerifyCertificate, "", true)
}
return nil, errors.New("could not marshal union type: all fields are null")
}
// SourceOracleUpdateSchemasTunnelMethodTunnelMethod - Connect through a jump server tunnel host using username and password authentication
type SourceOracleUpdateSchemasTunnelMethodTunnelMethod string
const (
SourceOracleUpdateSchemasTunnelMethodTunnelMethodSSHPasswordAuth SourceOracleUpdateSchemasTunnelMethodTunnelMethod = "SSH_PASSWORD_AUTH"
)
func (e SourceOracleUpdateSchemasTunnelMethodTunnelMethod) ToPointer() *SourceOracleUpdateSchemasTunnelMethodTunnelMethod {
return &e
}
func (e *SourceOracleUpdateSchemasTunnelMethodTunnelMethod) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "SSH_PASSWORD_AUTH":
*e = SourceOracleUpdateSchemasTunnelMethodTunnelMethod(v)
return nil
default:
return fmt.Errorf("invalid value for SourceOracleUpdateSchemasTunnelMethodTunnelMethod: %v", v)
}
}
type SourceOracleUpdatePasswordAuthentication struct {
// Hostname of the jump server host that allows inbound ssh tunnel.
TunnelHost string `json:"tunnel_host"`
// Connect through a jump server tunnel host using username and password authentication
tunnelMethod SourceOracleUpdateSchemasTunnelMethodTunnelMethod `const:"SSH_PASSWORD_AUTH" json:"tunnel_method"`
// Port on the proxy/jump server that accepts inbound ssh connections.
TunnelPort *int64 `default:"22" json:"tunnel_port"`
// OS-level username for logging into the jump server host
TunnelUser string `json:"tunnel_user"`
// OS-level password for logging into the jump server host
TunnelUserPassword string `json:"tunnel_user_password"`
}
func (s SourceOracleUpdatePasswordAuthentication) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(s, "", false)
}
func (s *SourceOracleUpdatePasswordAuthentication) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &s, "", false, true); err != nil {
return err
}
return nil
}
func (o *SourceOracleUpdatePasswordAuthentication) GetTunnelHost() string {
if o == nil {
return ""
}
return o.TunnelHost
}
func (o *SourceOracleUpdatePasswordAuthentication) GetTunnelMethod() SourceOracleUpdateSchemasTunnelMethodTunnelMethod {
return SourceOracleUpdateSchemasTunnelMethodTunnelMethodSSHPasswordAuth
}
func (o *SourceOracleUpdatePasswordAuthentication) GetTunnelPort() *int64 {
if o == nil {
return nil
}
return o.TunnelPort
}
func (o *SourceOracleUpdatePasswordAuthentication) GetTunnelUser() string {
if o == nil {
return ""
}
return o.TunnelUser
}
func (o *SourceOracleUpdatePasswordAuthentication) GetTunnelUserPassword() string {
if o == nil {
return ""
}
return o.TunnelUserPassword
}
// SourceOracleUpdateSchemasTunnelMethod - Connect through a jump server tunnel host using username and ssh key
type SourceOracleUpdateSchemasTunnelMethod string
const (
SourceOracleUpdateSchemasTunnelMethodSSHKeyAuth SourceOracleUpdateSchemasTunnelMethod = "SSH_KEY_AUTH"
)
func (e SourceOracleUpdateSchemasTunnelMethod) ToPointer() *SourceOracleUpdateSchemasTunnelMethod {
return &e
}
func (e *SourceOracleUpdateSchemasTunnelMethod) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "SSH_KEY_AUTH":
*e = SourceOracleUpdateSchemasTunnelMethod(v)
return nil
default:
return fmt.Errorf("invalid value for SourceOracleUpdateSchemasTunnelMethod: %v", v)
}
}
type SourceOracleUpdateSSHKeyAuthentication struct {
// OS-level user account ssh key credentials in RSA PEM format ( created with ssh-keygen -t rsa -m PEM -f myuser_rsa )
SSHKey string `json:"ssh_key"`
// Hostname of the jump server host that allows inbound ssh tunnel.
TunnelHost string `json:"tunnel_host"`
// Connect through a jump server tunnel host using username and ssh key
tunnelMethod SourceOracleUpdateSchemasTunnelMethod `const:"SSH_KEY_AUTH" json:"tunnel_method"`
// Port on the proxy/jump server that accepts inbound ssh connections.
TunnelPort *int64 `default:"22" json:"tunnel_port"`
// OS-level username for logging into the jump server host.
TunnelUser string `json:"tunnel_user"`
}
func (s SourceOracleUpdateSSHKeyAuthentication) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(s, "", false)
}
func (s *SourceOracleUpdateSSHKeyAuthentication) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &s, "", false, true); err != nil {
return err
}
return nil
}
func (o *SourceOracleUpdateSSHKeyAuthentication) GetSSHKey() string {
if o == nil {
return ""
}
return o.SSHKey
}
func (o *SourceOracleUpdateSSHKeyAuthentication) GetTunnelHost() string {
if o == nil {
return ""
}
return o.TunnelHost
}
func (o *SourceOracleUpdateSSHKeyAuthentication) GetTunnelMethod() SourceOracleUpdateSchemasTunnelMethod {
return SourceOracleUpdateSchemasTunnelMethodSSHKeyAuth
}
func (o *SourceOracleUpdateSSHKeyAuthentication) GetTunnelPort() *int64 {
if o == nil {
return nil
}
return o.TunnelPort
}
func (o *SourceOracleUpdateSSHKeyAuthentication) GetTunnelUser() string {
if o == nil {
return ""
}
return o.TunnelUser
}
// SourceOracleUpdateTunnelMethod - No ssh tunnel needed to connect to database
type SourceOracleUpdateTunnelMethod string
const (
SourceOracleUpdateTunnelMethodNoTunnel SourceOracleUpdateTunnelMethod = "NO_TUNNEL"
)
func (e SourceOracleUpdateTunnelMethod) ToPointer() *SourceOracleUpdateTunnelMethod {
return &e
}
func (e *SourceOracleUpdateTunnelMethod) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "NO_TUNNEL":
*e = SourceOracleUpdateTunnelMethod(v)
return nil
default:
return fmt.Errorf("invalid value for SourceOracleUpdateTunnelMethod: %v", v)
}
}
type SourceOracleUpdateNoTunnel struct {
// No ssh tunnel needed to connect to database
tunnelMethod SourceOracleUpdateTunnelMethod `const:"NO_TUNNEL" json:"tunnel_method"`
}
func (s SourceOracleUpdateNoTunnel) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(s, "", false)
}
func (s *SourceOracleUpdateNoTunnel) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &s, "", false, true); err != nil {
return err
}
return nil
}
func (o *SourceOracleUpdateNoTunnel) GetTunnelMethod() SourceOracleUpdateTunnelMethod {
return SourceOracleUpdateTunnelMethodNoTunnel
}
type SourceOracleUpdateSSHTunnelMethodType string
const (
SourceOracleUpdateSSHTunnelMethodTypeSourceOracleUpdateNoTunnel SourceOracleUpdateSSHTunnelMethodType = "source-oracle-update_No Tunnel"
SourceOracleUpdateSSHTunnelMethodTypeSourceOracleUpdateSSHKeyAuthentication SourceOracleUpdateSSHTunnelMethodType = "source-oracle-update_SSH Key Authentication"
SourceOracleUpdateSSHTunnelMethodTypeSourceOracleUpdatePasswordAuthentication SourceOracleUpdateSSHTunnelMethodType = "source-oracle-update_Password Authentication"
)
// SourceOracleUpdateSSHTunnelMethod - Whether to initiate an SSH tunnel before connecting to the database, and if so, which kind of authentication to use.
type SourceOracleUpdateSSHTunnelMethod struct {
SourceOracleUpdateNoTunnel *SourceOracleUpdateNoTunnel
SourceOracleUpdateSSHKeyAuthentication *SourceOracleUpdateSSHKeyAuthentication
SourceOracleUpdatePasswordAuthentication *SourceOracleUpdatePasswordAuthentication
Type SourceOracleUpdateSSHTunnelMethodType
}
func CreateSourceOracleUpdateSSHTunnelMethodSourceOracleUpdateNoTunnel(sourceOracleUpdateNoTunnel SourceOracleUpdateNoTunnel) SourceOracleUpdateSSHTunnelMethod {
typ := SourceOracleUpdateSSHTunnelMethodTypeSourceOracleUpdateNoTunnel
return SourceOracleUpdateSSHTunnelMethod{
SourceOracleUpdateNoTunnel: &sourceOracleUpdateNoTunnel,
Type: typ,
}
}
func CreateSourceOracleUpdateSSHTunnelMethodSourceOracleUpdateSSHKeyAuthentication(sourceOracleUpdateSSHKeyAuthentication SourceOracleUpdateSSHKeyAuthentication) SourceOracleUpdateSSHTunnelMethod {
typ := SourceOracleUpdateSSHTunnelMethodTypeSourceOracleUpdateSSHKeyAuthentication
return SourceOracleUpdateSSHTunnelMethod{
SourceOracleUpdateSSHKeyAuthentication: &sourceOracleUpdateSSHKeyAuthentication,
Type: typ,
}
}
func CreateSourceOracleUpdateSSHTunnelMethodSourceOracleUpdatePasswordAuthentication(sourceOracleUpdatePasswordAuthentication SourceOracleUpdatePasswordAuthentication) SourceOracleUpdateSSHTunnelMethod {
typ := SourceOracleUpdateSSHTunnelMethodTypeSourceOracleUpdatePasswordAuthentication
return SourceOracleUpdateSSHTunnelMethod{
SourceOracleUpdatePasswordAuthentication: &sourceOracleUpdatePasswordAuthentication,
Type: typ,
}
}
func (u *SourceOracleUpdateSSHTunnelMethod) UnmarshalJSON(data []byte) error {
sourceOracleUpdateNoTunnel := new(SourceOracleUpdateNoTunnel)
if err := utils.UnmarshalJSON(data, &sourceOracleUpdateNoTunnel, "", true, true); err == nil {
u.SourceOracleUpdateNoTunnel = sourceOracleUpdateNoTunnel
u.Type = SourceOracleUpdateSSHTunnelMethodTypeSourceOracleUpdateNoTunnel
return nil
}
sourceOracleUpdateSSHKeyAuthentication := new(SourceOracleUpdateSSHKeyAuthentication)
if err := utils.UnmarshalJSON(data, &sourceOracleUpdateSSHKeyAuthentication, "", true, true); err == nil {
u.SourceOracleUpdateSSHKeyAuthentication = sourceOracleUpdateSSHKeyAuthentication
u.Type = SourceOracleUpdateSSHTunnelMethodTypeSourceOracleUpdateSSHKeyAuthentication
return nil
}
sourceOracleUpdatePasswordAuthentication := new(SourceOracleUpdatePasswordAuthentication)
if err := utils.UnmarshalJSON(data, &sourceOracleUpdatePasswordAuthentication, "", true, true); err == nil {
u.SourceOracleUpdatePasswordAuthentication = sourceOracleUpdatePasswordAuthentication
u.Type = SourceOracleUpdateSSHTunnelMethodTypeSourceOracleUpdatePasswordAuthentication
return nil
}
return errors.New("could not unmarshal into supported union types")
}
func (u SourceOracleUpdateSSHTunnelMethod) MarshalJSON() ([]byte, error) {
if u.SourceOracleUpdateNoTunnel != nil {
return utils.MarshalJSON(u.SourceOracleUpdateNoTunnel, "", true)
}
if u.SourceOracleUpdateSSHKeyAuthentication != nil {
return utils.MarshalJSON(u.SourceOracleUpdateSSHKeyAuthentication, "", true)
}
if u.SourceOracleUpdatePasswordAuthentication != nil {
return utils.MarshalJSON(u.SourceOracleUpdatePasswordAuthentication, "", true)
}
return nil, errors.New("could not marshal union type: all fields are null")
}
type SourceOracleUpdate struct {
// Connect data that will be used for DB connection
ConnectionData *ConnectBy `json:"connection_data,omitempty"`
// The encryption method with is used when communicating with the database.
Encryption Encryption `json:"encryption"`
// Hostname of the database.
Host string `json:"host"`
// Additional properties to pass to the JDBC URL string when connecting to the database formatted as 'key=value' pairs separated by the symbol '&'. (example: key1=value1&key2=value2&key3=value3).
JdbcURLParams *string `json:"jdbc_url_params,omitempty"`
// The password associated with the username.
Password *string `json:"password,omitempty"`
// Port of the database.
// Oracle Corporations recommends the following port numbers:
// 1521 - Default listening port for client connections to the listener.
// 2484 - Recommended and officially registered listening port for client connections to the listener using TCP/IP with SSL
Port *int64 `default:"1521" json:"port"`
// The list of schemas to sync from. Defaults to user. Case sensitive.
Schemas []string `json:"schemas,omitempty"`
// Whether to initiate an SSH tunnel before connecting to the database, and if so, which kind of authentication to use.
TunnelMethod *SourceOracleUpdateSSHTunnelMethod `json:"tunnel_method,omitempty"`
// The username which is used to access the database.
Username string `json:"username"`
}
func (s SourceOracleUpdate) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(s, "", false)
}
func (s *SourceOracleUpdate) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil {
return err
}
return nil
}
func (o *SourceOracleUpdate) GetConnectionData() *ConnectBy {
if o == nil {
return nil
}
return o.ConnectionData
}
func (o *SourceOracleUpdate) GetEncryption() Encryption {
if o == nil {
return Encryption{}
}
return o.Encryption
}
func (o *SourceOracleUpdate) GetHost() string {
if o == nil {
return ""
}
return o.Host
}
func (o *SourceOracleUpdate) GetJdbcURLParams() *string {
if o == nil {
return nil
}
return o.JdbcURLParams
}
func (o *SourceOracleUpdate) GetPassword() *string {
if o == nil {
return nil
}
return o.Password
}
func (o *SourceOracleUpdate) GetPort() *int64 {
if o == nil {
return nil
}
return o.Port
}
func (o *SourceOracleUpdate) GetSchemas() []string {
if o == nil {
return nil
}
return o.Schemas
}
func (o *SourceOracleUpdate) GetTunnelMethod() *SourceOracleUpdateSSHTunnelMethod {
if o == nil {
return nil
}
return o.TunnelMethod
}
func (o *SourceOracleUpdate) GetUsername() string {
if o == nil {
return ""
}
return o.Username
}