-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdeclarative_component_schema.py
2451 lines (2186 loc) · 102 KB
/
declarative_component_schema.py
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
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# generated by datamodel-codegen:
# filename: declarative_component_schema.yaml
from __future__ import annotations
from enum import Enum
from typing import Any, Dict, List, Literal, Optional, Union
from pydantic.v1 import BaseModel, Extra, Field
class AuthFlowType(Enum):
oauth2_0 = "oauth2.0"
oauth1_0 = "oauth1.0"
class BasicHttpAuthenticator(BaseModel):
type: Literal["BasicHttpAuthenticator"]
username: str = Field(
...,
description="The username that will be combined with the password, base64 encoded and used to make requests. Fill it in the user inputs.",
examples=["{{ config['username'] }}", "{{ config['api_key'] }}"],
title="Username",
)
password: Optional[str] = Field(
"",
description="The password that will be combined with the username, base64 encoded and used to make requests. Fill it in the user inputs.",
examples=["{{ config['password'] }}", ""],
title="Password",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class BearerAuthenticator(BaseModel):
type: Literal["BearerAuthenticator"]
api_token: str = Field(
...,
description="Token to inject as request header for authenticating with the API.",
examples=["{{ config['api_key'] }}", "{{ config['token'] }}"],
title="Bearer Token",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class CheckStream(BaseModel):
type: Literal["CheckStream"]
stream_names: List[str] = Field(
...,
description="Names of the streams to try reading from when running a check operation.",
examples=[["users"], ["users", "contacts"]],
title="Stream Names",
)
class CheckDynamicStream(BaseModel):
type: Literal["CheckDynamicStream"]
stream_count: int = Field(
...,
description="Numbers of the streams to try reading from when running a check operation.",
title="Stream Count",
)
use_check_availability: Optional[bool] = Field(
True,
description="Enables stream check availability. This field is automatically set by the CDK.",
title="Use Check Availability",
)
class ConcurrencyLevel(BaseModel):
type: Optional[Literal["ConcurrencyLevel"]] = None
default_concurrency: Union[int, str] = Field(
...,
description="The amount of concurrency that will applied during a sync. This value can be hardcoded or user-defined in the config if different users have varying volume thresholds in the target API.",
examples=[10, "{{ config['num_workers'] or 10 }}"],
title="Default Concurrency",
)
max_concurrency: Optional[int] = Field(
None,
description="The maximum level of concurrency that will be used during a sync. This becomes a required field when the default_concurrency derives from the config, because it serves as a safeguard against a user-defined threshold that is too high.",
examples=[20, 100],
title="Max Concurrency",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class ConstantBackoffStrategy(BaseModel):
type: Literal["ConstantBackoffStrategy"]
backoff_time_in_seconds: Union[float, str] = Field(
...,
description="Backoff time in seconds.",
examples=[30, 30.5, "{{ config['backoff_time'] }}"],
title="Backoff Time",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class CursorPagination(BaseModel):
type: Literal["CursorPagination"]
cursor_value: str = Field(
...,
description="Value of the cursor defining the next page to fetch.",
examples=[
"{{ headers.link.next.cursor }}",
"{{ last_record['key'] }}",
"{{ response['nextPage'] }}",
],
title="Cursor Value",
)
page_size: Optional[int] = Field(
None,
description="The number of records to include in each pages.",
examples=[100],
title="Page Size",
)
stop_condition: Optional[str] = Field(
None,
description="Template string evaluating when to stop paginating.",
examples=[
"{{ response.data.has_more is false }}",
"{{ 'next' not in headers['link'] }}",
],
title="Stop Condition",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class CustomAuthenticator(BaseModel):
class Config:
extra = Extra.allow
type: Literal["CustomAuthenticator"]
class_name: str = Field(
...,
description="Fully-qualified name of the class that will be implementing the custom authentication strategy. Has to be a sub class of DeclarativeAuthenticator. The format is `source_<name>.<package>.<class_name>`.",
examples=["source_railz.components.ShortLivedTokenAuthenticator"],
title="Class Name",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class CustomBackoffStrategy(BaseModel):
class Config:
extra = Extra.allow
type: Literal["CustomBackoffStrategy"]
class_name: str = Field(
...,
description="Fully-qualified name of the class that will be implementing the custom backoff strategy. The format is `source_<name>.<package>.<class_name>`.",
examples=["source_railz.components.MyCustomBackoffStrategy"],
title="Class Name",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class CustomErrorHandler(BaseModel):
class Config:
extra = Extra.allow
type: Literal["CustomErrorHandler"]
class_name: str = Field(
...,
description="Fully-qualified name of the class that will be implementing the custom error handler. The format is `source_<name>.<package>.<class_name>`.",
examples=["source_railz.components.MyCustomErrorHandler"],
title="Class Name",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class CustomIncrementalSync(BaseModel):
class Config:
extra = Extra.allow
type: Literal["CustomIncrementalSync"]
class_name: str = Field(
...,
description="Fully-qualified name of the class that will be implementing the custom incremental sync. The format is `source_<name>.<package>.<class_name>`.",
examples=["source_railz.components.MyCustomIncrementalSync"],
title="Class Name",
)
cursor_field: str = Field(
...,
description="The location of the value on a record that will be used as a bookmark during sync.",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class CustomPaginationStrategy(BaseModel):
class Config:
extra = Extra.allow
type: Literal["CustomPaginationStrategy"]
class_name: str = Field(
...,
description="Fully-qualified name of the class that will be implementing the custom pagination strategy. The format is `source_<name>.<package>.<class_name>`.",
examples=["source_railz.components.MyCustomPaginationStrategy"],
title="Class Name",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class CustomRecordExtractor(BaseModel):
class Config:
extra = Extra.allow
type: Literal["CustomRecordExtractor"]
class_name: str = Field(
...,
description="Fully-qualified name of the class that will be implementing the custom record extraction strategy. The format is `source_<name>.<package>.<class_name>`.",
examples=["source_railz.components.MyCustomRecordExtractor"],
title="Class Name",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class CustomRecordFilter(BaseModel):
class Config:
extra = Extra.allow
type: Literal["CustomRecordFilter"]
class_name: str = Field(
...,
description="Fully-qualified name of the class that will be implementing the custom record filter strategy. The format is `source_<name>.<package>.<class_name>`.",
examples=["source_railz.components.MyCustomCustomRecordFilter"],
title="Class Name",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class CustomRequester(BaseModel):
class Config:
extra = Extra.allow
type: Literal["CustomRequester"]
class_name: str = Field(
...,
description="Fully-qualified name of the class that will be implementing the custom requester strategy. The format is `source_<name>.<package>.<class_name>`.",
examples=["source_railz.components.MyCustomRecordExtractor"],
title="Class Name",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class CustomRetriever(BaseModel):
class Config:
extra = Extra.allow
type: Literal["CustomRetriever"]
class_name: str = Field(
...,
description="Fully-qualified name of the class that will be implementing the custom retriever strategy. The format is `source_<name>.<package>.<class_name>`.",
examples=["source_railz.components.MyCustomRetriever"],
title="Class Name",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class CustomPartitionRouter(BaseModel):
class Config:
extra = Extra.allow
type: Literal["CustomPartitionRouter"]
class_name: str = Field(
...,
description="Fully-qualified name of the class that will be implementing the custom partition router. The format is `source_<name>.<package>.<class_name>`.",
examples=["source_railz.components.MyCustomPartitionRouter"],
title="Class Name",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class CustomSchemaLoader(BaseModel):
class Config:
extra = Extra.allow
type: Literal["CustomSchemaLoader"]
class_name: str = Field(
...,
description="Fully-qualified name of the class that will be implementing the custom schema loader. The format is `source_<name>.<package>.<class_name>`.",
examples=["source_railz.components.MyCustomSchemaLoader"],
title="Class Name",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class CustomSchemaNormalization(BaseModel):
class Config:
extra = Extra.allow
type: Literal["CustomSchemaNormalization"]
class_name: str = Field(
...,
description="Fully-qualified name of the class that will be implementing the custom normalization. The format is `source_<name>.<package>.<class_name>`.",
examples=[
"source_amazon_seller_partner.components.LedgerDetailedViewReportsTypeTransformer"
],
title="Class Name",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class CustomStateMigration(BaseModel):
class Config:
extra = Extra.allow
type: Literal["CustomStateMigration"]
class_name: str = Field(
...,
description="Fully-qualified name of the class that will be implementing the custom state migration. The format is `source_<name>.<package>.<class_name>`.",
examples=["source_railz.components.MyCustomStateMigration"],
title="Class Name",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class CustomTransformation(BaseModel):
class Config:
extra = Extra.allow
type: Literal["CustomTransformation"]
class_name: str = Field(
...,
description="Fully-qualified name of the class that will be implementing the custom transformation. The format is `source_<name>.<package>.<class_name>`.",
examples=["source_railz.components.MyCustomTransformation"],
title="Class Name",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class LegacyToPerPartitionStateMigration(BaseModel):
class Config:
extra = Extra.allow
type: Optional[Literal["LegacyToPerPartitionStateMigration"]] = None
class Clamping(BaseModel):
target: str = Field(
...,
description="The period of time that datetime windows will be clamped by",
examples=["DAY", "WEEK", "MONTH", "{{ config['target'] }}"],
title="Target",
)
target_details: Optional[Dict[str, Any]] = None
class Algorithm(Enum):
HS256 = "HS256"
HS384 = "HS384"
HS512 = "HS512"
ES256 = "ES256"
ES256K = "ES256K"
ES384 = "ES384"
ES512 = "ES512"
RS256 = "RS256"
RS384 = "RS384"
RS512 = "RS512"
PS256 = "PS256"
PS384 = "PS384"
PS512 = "PS512"
EdDSA = "EdDSA"
class JwtHeaders(BaseModel):
class Config:
extra = Extra.forbid
kid: Optional[str] = Field(
None,
description="Private key ID for user account.",
examples=["{{ config['kid'] }}"],
title="Key Identifier",
)
typ: Optional[str] = Field(
"JWT",
description="The media type of the complete JWT.",
examples=["JWT"],
title="Type",
)
cty: Optional[str] = Field(
None,
description="Content type of JWT header.",
examples=["JWT"],
title="Content Type",
)
class JwtPayload(BaseModel):
class Config:
extra = Extra.forbid
iss: Optional[str] = Field(
None,
description="The user/principal that issued the JWT. Commonly a value unique to the user.",
examples=["{{ config['iss'] }}"],
title="Issuer",
)
sub: Optional[str] = Field(
None,
description="The subject of the JWT. Commonly defined by the API.",
title="Subject",
)
aud: Optional[str] = Field(
None,
description="The recipient that the JWT is intended for. Commonly defined by the API.",
examples=["appstoreconnect-v1"],
title="Audience",
)
class JwtAuthenticator(BaseModel):
type: Literal["JwtAuthenticator"]
secret_key: str = Field(
...,
description="Secret used to sign the JSON web token.",
examples=["{{ config['secret_key'] }}"],
)
base64_encode_secret_key: Optional[bool] = Field(
False,
description='When set to true, the secret key will be base64 encoded prior to being encoded as part of the JWT. Only set to "true" when required by the API.',
)
algorithm: Algorithm = Field(
...,
description="Algorithm used to sign the JSON web token.",
examples=["ES256", "HS256", "RS256", "{{ config['algorithm'] }}"],
)
token_duration: Optional[int] = Field(
1200,
description="The amount of time in seconds a JWT token can be valid after being issued.",
examples=[1200, 3600],
title="Token Duration",
)
header_prefix: Optional[str] = Field(
None,
description="The prefix to be used within the Authentication header.",
examples=["Bearer", "Basic"],
title="Header Prefix",
)
jwt_headers: Optional[JwtHeaders] = Field(
None,
description="JWT headers used when signing JSON web token.",
title="JWT Headers",
)
additional_jwt_headers: Optional[Dict[str, Any]] = Field(
None,
description="Additional headers to be included with the JWT headers object.",
title="Additional JWT Headers",
)
jwt_payload: Optional[JwtPayload] = Field(
None,
description="JWT Payload used when signing JSON web token.",
title="JWT Payload",
)
additional_jwt_payload: Optional[Dict[str, Any]] = Field(
None,
description="Additional properties to be added to the JWT payload.",
title="Additional JWT Payload Properties",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class RefreshTokenUpdater(BaseModel):
refresh_token_name: Optional[str] = Field(
"refresh_token",
description="The name of the property which contains the updated refresh token in the response from the token refresh endpoint.",
examples=["refresh_token"],
title="Refresh Token Property Name",
)
access_token_config_path: Optional[List[str]] = Field(
["credentials", "access_token"],
description="Config path to the access token. Make sure the field actually exists in the config.",
examples=[["credentials", "access_token"], ["access_token"]],
title="Config Path To Access Token",
)
refresh_token_config_path: Optional[List[str]] = Field(
["credentials", "refresh_token"],
description="Config path to the access token. Make sure the field actually exists in the config.",
examples=[["credentials", "refresh_token"], ["refresh_token"]],
title="Config Path To Refresh Token",
)
token_expiry_date_config_path: Optional[List[str]] = Field(
["credentials", "token_expiry_date"],
description="Config path to the expiry date. Make sure actually exists in the config.",
examples=[["credentials", "token_expiry_date"]],
title="Config Path To Expiry Date",
)
refresh_token_error_status_codes: Optional[List[int]] = Field(
[],
description="Status Codes to Identify refresh token error in response (Refresh Token Error Key and Refresh Token Error Values should be also specified). Responses with one of the error status code and containing an error value will be flagged as a config error",
examples=[[400, 500]],
title="Refresh Token Error Status Codes",
)
refresh_token_error_key: Optional[str] = Field(
"",
description="Key to Identify refresh token error in response (Refresh Token Error Status Codes and Refresh Token Error Values should be also specified).",
examples=["error"],
title="Refresh Token Error Key",
)
refresh_token_error_values: Optional[List[str]] = Field(
[],
description='List of values to check for exception during token refresh process. Used to check if the error found in the response matches the key from the Refresh Token Error Key field (e.g. response={"error": "invalid_grant"}). Only responses with one of the error status code and containing an error value will be flagged as a config error',
examples=[["invalid_grant", "invalid_permissions"]],
title="Refresh Token Error Values",
)
class OAuthAuthenticator(BaseModel):
type: Literal["OAuthAuthenticator"]
client_id_name: Optional[str] = Field(
"client_id",
description="The name of the property to use to refresh the `access_token`.",
examples=["custom_app_id"],
title="Client ID Property Name",
)
client_id: Optional[str] = Field(
None,
description="The OAuth client ID. Fill it in the user inputs.",
examples=["{{ config['client_id }}", "{{ config['credentials']['client_id }}"],
title="Client ID",
)
client_secret_name: Optional[str] = Field(
"client_secret",
description="The name of the property to use to refresh the `access_token`.",
examples=["custom_app_secret"],
title="Client Secret Property Name",
)
client_secret: Optional[str] = Field(
None,
description="The OAuth client secret. Fill it in the user inputs.",
examples=[
"{{ config['client_secret }}",
"{{ config['credentials']['client_secret }}",
],
title="Client Secret",
)
refresh_token_name: Optional[str] = Field(
"refresh_token",
description="The name of the property to use to refresh the `access_token`.",
examples=["custom_app_refresh_value"],
title="Refresh Token Property Name",
)
refresh_token: Optional[str] = Field(
None,
description="Credential artifact used to get a new access token.",
examples=[
"{{ config['refresh_token'] }}",
"{{ config['credentials]['refresh_token'] }}",
],
title="Refresh Token",
)
token_refresh_endpoint: Optional[str] = Field(
None,
description="The full URL to call to obtain a new access token.",
examples=["https://connect.squareup.com/oauth2/token"],
title="Token Refresh Endpoint",
)
access_token_name: Optional[str] = Field(
"access_token",
description="The name of the property which contains the access token in the response from the token refresh endpoint.",
examples=["access_token"],
title="Access Token Property Name",
)
access_token_value: Optional[str] = Field(
None,
description="The value of the access_token to bypass the token refreshing using `refresh_token`.",
examples=["secret_access_token_value"],
title="Access Token Value",
)
expires_in_name: Optional[str] = Field(
"expires_in",
description="The name of the property which contains the expiry date in the response from the token refresh endpoint.",
examples=["expires_in"],
title="Token Expiry Property Name",
)
grant_type_name: Optional[str] = Field(
"grant_type",
description="The name of the property to use to refresh the `access_token`.",
examples=["custom_grant_type"],
title="Grant Type Property Name",
)
grant_type: Optional[str] = Field(
"refresh_token",
description="Specifies the OAuth2 grant type. If set to refresh_token, the refresh_token needs to be provided as well. For client_credentials, only client id and secret are required. Other grant types are not officially supported.",
examples=["refresh_token", "client_credentials"],
title="Grant Type",
)
refresh_request_body: Optional[Dict[str, Any]] = Field(
None,
description="Body of the request sent to get a new access token.",
examples=[
{
"applicationId": "{{ config['application_id'] }}",
"applicationSecret": "{{ config['application_secret'] }}",
"token": "{{ config['token'] }}",
}
],
title="Refresh Request Body",
)
refresh_request_headers: Optional[Dict[str, Any]] = Field(
None,
description="Headers of the request sent to get a new access token.",
examples=[
{
"Authorization": "<AUTH_TOKEN>",
"Content-Type": "application/x-www-form-urlencoded",
}
],
title="Refresh Request Headers",
)
scopes: Optional[List[str]] = Field(
None,
description="List of scopes that should be granted to the access token.",
examples=[
["crm.list.read", "crm.objects.contacts.read", "crm.schema.contacts.read"]
],
title="Scopes",
)
token_expiry_date: Optional[str] = Field(
None,
description="The access token expiry date.",
examples=["2023-04-06T07:12:10.421833+00:00", 1680842386],
title="Token Expiry Date",
)
token_expiry_date_format: Optional[str] = Field(
None,
description="The format of the time to expiration datetime. Provide it if the time is returned as a date-time string instead of seconds.",
examples=["%Y-%m-%d %H:%M:%S.%f+00:00"],
title="Token Expiry Date Format",
)
refresh_token_updater: Optional[RefreshTokenUpdater] = Field(
None,
description="When the token updater is defined, new refresh tokens, access tokens and the access token expiry date are written back from the authentication response to the config object. This is important if the refresh token can only used once.",
title="Token Updater",
)
profile_assertion: Optional[JwtAuthenticator] = Field(
None,
description="The authenticator being used to authenticate the client authenticator.",
title="Profile Assertion",
)
use_profile_assertion: Optional[bool] = Field(
False,
description="Enable using profile assertion as a flow for OAuth authorization.",
title="Use Profile Assertion",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class Rate(BaseModel):
class Config:
extra = Extra.allow
limit: Union[int, str] = Field(
...,
description="The maximum number of calls allowed within the interval.",
title="Limit",
)
interval: str = Field(
...,
description="The time interval for the rate limit.",
examples=["PT1H", "P1D"],
title="Interval",
)
class HttpRequestRegexMatcher(BaseModel):
class Config:
extra = Extra.allow
method: Optional[str] = Field(
None, description="The HTTP method to match (e.g., GET, POST).", title="Method"
)
url_base: Optional[str] = Field(
None,
description='The base URL (scheme and host, e.g. "https://api.example.com") to match.',
title="URL Base",
)
url_path_pattern: Optional[str] = Field(
None,
description="A regular expression pattern to match the URL path.",
title="URL Path Pattern",
)
params: Optional[Dict[str, Any]] = Field(
None, description="The query parameters to match.", title="Parameters"
)
headers: Optional[Dict[str, Any]] = Field(
None, description="The headers to match.", title="Headers"
)
class DpathExtractor(BaseModel):
type: Literal["DpathExtractor"]
field_path: List[str] = Field(
...,
description='List of potentially nested fields describing the full path of the field to extract. Use "*" to extract all values from an array. See more info in the [docs](https://docs.airbyte.com/connector-development/config-based/understanding-the-yaml-file/record-selector).',
examples=[
["data"],
["data", "records"],
["data", "{{ parameters.name }}"],
["data", "*", "record"],
],
title="Field Path",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class ResponseToFileExtractor(BaseModel):
type: Literal["ResponseToFileExtractor"]
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class ExponentialBackoffStrategy(BaseModel):
type: Literal["ExponentialBackoffStrategy"]
factor: Optional[Union[float, str]] = Field(
5,
description="Multiplicative constant applied on each retry.",
examples=[5, 5.5, "10"],
title="Factor",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class SessionTokenRequestBearerAuthenticator(BaseModel):
type: Literal["Bearer"]
class HttpMethod(Enum):
GET = "GET"
POST = "POST"
class Action(Enum):
SUCCESS = "SUCCESS"
FAIL = "FAIL"
RETRY = "RETRY"
IGNORE = "IGNORE"
RATE_LIMITED = "RATE_LIMITED"
class FailureType(Enum):
system_error = "system_error"
config_error = "config_error"
transient_error = "transient_error"
class HttpResponseFilter(BaseModel):
type: Literal["HttpResponseFilter"]
action: Optional[Action] = Field(
None,
description="Action to execute if a response matches the filter.",
examples=["SUCCESS", "FAIL", "RETRY", "IGNORE", "RATE_LIMITED"],
title="Action",
)
failure_type: Optional[FailureType] = Field(
None,
description="Failure type of traced exception if a response matches the filter.",
examples=["system_error", "config_error", "transient_error"],
title="Failure Type",
)
error_message: Optional[str] = Field(
None,
description="Error Message to display if the response matches the filter.",
title="Error Message",
)
error_message_contains: Optional[str] = Field(
None,
description="Match the response if its error message contains the substring.",
example=["This API operation is not enabled for this site"],
title="Error Message Substring",
)
http_codes: Optional[List[int]] = Field(
None,
description="Match the response if its HTTP code is included in this list.",
examples=[[420, 429], [500]],
title="HTTP Codes",
unique_items=True,
)
predicate: Optional[str] = Field(
None,
description="Match the response if the predicate evaluates to true.",
examples=[
"{{ 'Too much requests' in response }}",
"{{ 'error_code' in response and response['error_code'] == 'ComplexityException' }}",
],
title="Predicate",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class ComplexFieldType(BaseModel):
field_type: str
items: Optional[Union[str, ComplexFieldType]] = None
class TypesMap(BaseModel):
target_type: Union[str, List[str], ComplexFieldType]
current_type: Union[str, List[str]]
condition: Optional[str] = None
class SchemaTypeIdentifier(BaseModel):
type: Optional[Literal["SchemaTypeIdentifier"]] = None
schema_pointer: Optional[List[str]] = Field(
[],
description="List of nested fields defining the schema field path to extract. Defaults to [].",
title="Schema Path",
)
key_pointer: List[str] = Field(
...,
description="List of potentially nested fields describing the full path of the field key to extract.",
title="Key Path",
)
type_pointer: Optional[List[str]] = Field(
None,
description="List of potentially nested fields describing the full path of the field type to extract.",
title="Type Path",
)
types_mapping: Optional[List[TypesMap]] = None
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class InlineSchemaLoader(BaseModel):
type: Literal["InlineSchemaLoader"]
schema_: Optional[Dict[str, Any]] = Field(
None,
alias="schema",
description='Describes a streams\' schema. Refer to the <a href="https://docs.airbyte.com/understanding-airbyte/supported-data-types/">Data Types documentation</a> for more details on which types are valid.',
title="Schema",
)
class JsonFileSchemaLoader(BaseModel):
type: Literal["JsonFileSchemaLoader"]
file_path: Optional[str] = Field(
None,
description="Path to the JSON file defining the schema. The path is relative to the connector module's root.",
example=["./schemas/users.json"],
title="File Path",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class JsonDecoder(BaseModel):
type: Literal["JsonDecoder"]
class JsonlDecoder(BaseModel):
type: Literal["JsonlDecoder"]
class KeysToLower(BaseModel):
type: Literal["KeysToLower"]
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class KeysToSnakeCase(BaseModel):
type: Literal["KeysToSnakeCase"]
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class FlattenFields(BaseModel):
type: Literal["FlattenFields"]
flatten_lists: Optional[bool] = Field(
True,
description="Whether to flatten lists or leave it as is. Default is True.",
title="Flatten Lists",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class DpathFlattenFields(BaseModel):
type: Literal["DpathFlattenFields"]
field_path: List[str] = Field(
...,
description="A path to field that needs to be flattened.",
examples=[["data"], ["data", "*", "field"]],
title="Field Path",
)
delete_origin_value: Optional[bool] = Field(
None,
description="Whether to delete the origin value or keep it. Default is False.",
title="Delete Origin Value",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class KeysReplace(BaseModel):
type: Literal["KeysReplace"]
old: str = Field(
...,
description="Old value to replace.",
examples=[
" ",
"{{ record.id }}",
"{{ config['id'] }}",
"{{ stream_slice['id'] }}",
],
title="Old value",
)
new: str = Field(
...,
description="New value to set.",
examples=[
"_",
"{{ record.id }}",
"{{ config['id'] }}",
"{{ stream_slice['id'] }}",
],
title="New value",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class IterableDecoder(BaseModel):
type: Literal["IterableDecoder"]
class XmlDecoder(BaseModel):
type: Literal["XmlDecoder"]
class CustomDecoder(BaseModel):
class Config:
extra = Extra.allow
type: Literal["CustomDecoder"]
class_name: str = Field(
...,
description="Fully-qualified name of the class that will be implementing the custom decoding. Has to be a sub class of Decoder. The format is `source_<name>.<package>.<class_name>`.",
examples=["source_amazon_ads.components.GzipJsonlDecoder"],
title="Class Name",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class MinMaxDatetime(BaseModel):
type: Literal["MinMaxDatetime"]
datetime: str = Field(
...,
description="Datetime value.",
examples=["2021-01-01", "2021-01-01T00:00:00Z", "{{ config['start_time'] }}"],
title="Datetime",
)
datetime_format: Optional[str] = Field(
"",
description='Format of the datetime value. Defaults to "%Y-%m-%dT%H:%M:%S.%f%z" if left empty. Use placeholders starting with "%" to describe the format the API is using. The following placeholders are available:\n * **%s**: Epoch unix timestamp - `1686218963`\n * **%s_as_float**: Epoch unix timestamp in seconds as float with microsecond precision - `1686218963.123456`\n * **%ms**: Epoch unix timestamp - `1686218963123`\n * **%a**: Weekday (abbreviated) - `Sun`\n * **%A**: Weekday (full) - `Sunday`\n * **%w**: Weekday (decimal) - `0` (Sunday), `6` (Saturday)\n * **%d**: Day of the month (zero-padded) - `01`, `02`, ..., `31`\n * **%b**: Month (abbreviated) - `Jan`\n * **%B**: Month (full) - `January`\n * **%m**: Month (zero-padded) - `01`, `02`, ..., `12`\n * **%y**: Year (without century, zero-padded) - `00`, `01`, ..., `99`\n * **%Y**: Year (with century) - `0001`, `0002`, ..., `9999`\n * **%H**: Hour (24-hour, zero-padded) - `00`, `01`, ..., `23`\n * **%I**: Hour (12-hour, zero-padded) - `01`, `02`, ..., `12`\n * **%p**: AM/PM indicator\n * **%M**: Minute (zero-padded) - `00`, `01`, ..., `59`\n * **%S**: Second (zero-padded) - `00`, `01`, ..., `59`\n * **%f**: Microsecond (zero-padded to 6 digits) - `000000`, `000001`, ..., `999999`\n * **%_ms**: Millisecond (zero-padded to 3 digits) - `000`, `001`, ..., `999`\n * **%z**: UTC offset - `(empty)`, `+0000`, `-04:00`\n * **%Z**: Time zone name - `(empty)`, `UTC`, `GMT`\n * **%j**: Day of the year (zero-padded) - `001`, `002`, ..., `366`\n * **%U**: Week number of the year (Sunday as first day) - `00`, `01`, ..., `53`\n * **%W**: Week number of the year (Monday as first day) - `00`, `01`, ..., `53`\n * **%c**: Date and time representation - `Tue Aug 16 21:30:00 1988`\n * **%x**: Date representation - `08/16/1988`\n * **%X**: Time representation - `21:30:00`\n * **%%**: Literal \'%\' character\n\n Some placeholders depend on the locale of the underlying system - in most cases this locale is configured as en/US. For more information see the [Python documentation](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes).\n',
examples=["%Y-%m-%dT%H:%M:%S.%f%z", "%Y-%m-%d", "%s"],
title="Datetime Format",
)
max_datetime: Optional[str] = Field(
None,
description="Ceiling applied on the datetime value. Must be formatted with the datetime_format field.",
examples=["2021-01-01T00:00:00Z", "2021-01-01"],
title="Max Datetime",
)
min_datetime: Optional[str] = Field(
None,
description="Floor applied on the datetime value. Must be formatted with the datetime_format field.",
examples=["2010-01-01T00:00:00Z", "2010-01-01"],
title="Min Datetime",
)
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class NoAuth(BaseModel):
type: Literal["NoAuth"]
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
class NoPagination(BaseModel):
type: Literal["NoPagination"]
class State(BaseModel):
class Config:
extra = Extra.allow
min: int
max: int
class OauthConnectorInputSpecification(BaseModel):
class Config:
extra = Extra.allow
consent_url: str = Field(
...,
description="The DeclarativeOAuth Specific string URL string template to initiate the authentication.\nThe placeholders are replaced during the processing to provide neccessary values.",
examples=[
"https://domain.host.com/marketing_api/auth?{{client_id_key}}={{client_id_value}}&{{redirect_uri_key}}={{{{redirect_uri_value}} | urlEncoder}}&{{state_key}}={{state_value}}",
"https://endpoint.host.com/oauth2/authorize?{{client_id_key}}={{client_id_value}}&{{redirect_uri_key}}={{{{redirect_uri_value}} | urlEncoder}}&{{scope_key}}={{{{scope_value}} | urlEncoder}}&{{state_key}}={{state_value}}&subdomain={{subdomain}}",
],
title="Consent URL",
)
scope: Optional[str] = Field(
None,
description="The DeclarativeOAuth Specific string of the scopes needed to be grant for authenticated user.",
examples=["user:read user:read_orders workspaces:read"],
title="Scopes",
)
access_token_url: str = Field(
...,