Skip to content

Commit 4574e30

Browse files
committed
chore: format
1 parent 274733a commit 4574e30

File tree

1 file changed

+49
-71
lines changed

1 file changed

+49
-71
lines changed

airbyte_cdk/sources/declarative/models/declarative_component_schema.py

Lines changed: 49 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Copyright (c) 2025 Airbyte, Inc., all rights reserved.
2+
13
# generated by datamodel-codegen:
24
# filename: declarative_component_schema.yaml
35

@@ -618,9 +620,7 @@ class OAuthAuthenticator(BaseModel):
618620
scopes: Optional[List[str]] = Field(
619621
None,
620622
description="List of scopes that should be granted to the access token.",
621-
examples=[
622-
["crm.list.read", "crm.objects.contacts.read", "crm.schema.contacts.read"]
623-
],
623+
examples=[["crm.list.read", "crm.objects.contacts.read", "crm.schema.contacts.read"]],
624624
title="Scopes",
625625
)
626626
token_expiry_date: Optional[str] = Field(
@@ -1126,28 +1126,24 @@ class OAuthConfigSpecification(BaseModel):
11261126
class Config:
11271127
extra = Extra.allow
11281128

1129-
oauth_user_input_from_connector_config_specification: Optional[Dict[str, Any]] = (
1130-
Field(
1131-
None,
1132-
description="OAuth specific blob. This is a Json Schema used to validate Json configurations used as input to OAuth.\nMust be a valid non-nested JSON that refers to properties from ConnectorSpecification.connectionSpecification\nusing special annotation 'path_in_connector_config'.\nThese are input values the user is entering through the UI to authenticate to the connector, that might also shared\nas inputs for syncing data via the connector.\nExamples:\nif no connector values is shared during oauth flow, oauth_user_input_from_connector_config_specification=[]\nif connector values such as 'app_id' inside the top level are used to generate the API url for the oauth flow,\n oauth_user_input_from_connector_config_specification={\n app_id: {\n type: string\n path_in_connector_config: ['app_id']\n }\n }\nif connector values such as 'info.app_id' nested inside another object are used to generate the API url for the oauth flow,\n oauth_user_input_from_connector_config_specification={\n app_id: {\n type: string\n path_in_connector_config: ['info', 'app_id']\n }\n }",
1133-
examples=[
1134-
{"app_id": {"type": "string", "path_in_connector_config": ["app_id"]}},
1135-
{
1136-
"app_id": {
1137-
"type": "string",
1138-
"path_in_connector_config": ["info", "app_id"],
1139-
}
1140-
},
1141-
],
1142-
title="OAuth user input",
1143-
)
1129+
oauth_user_input_from_connector_config_specification: Optional[Dict[str, Any]] = Field(
1130+
None,
1131+
description="OAuth specific blob. This is a Json Schema used to validate Json configurations used as input to OAuth.\nMust be a valid non-nested JSON that refers to properties from ConnectorSpecification.connectionSpecification\nusing special annotation 'path_in_connector_config'.\nThese are input values the user is entering through the UI to authenticate to the connector, that might also shared\nas inputs for syncing data via the connector.\nExamples:\nif no connector values is shared during oauth flow, oauth_user_input_from_connector_config_specification=[]\nif connector values such as 'app_id' inside the top level are used to generate the API url for the oauth flow,\n oauth_user_input_from_connector_config_specification={\n app_id: {\n type: string\n path_in_connector_config: ['app_id']\n }\n }\nif connector values such as 'info.app_id' nested inside another object are used to generate the API url for the oauth flow,\n oauth_user_input_from_connector_config_specification={\n app_id: {\n type: string\n path_in_connector_config: ['info', 'app_id']\n }\n }",
1132+
examples=[
1133+
{"app_id": {"type": "string", "path_in_connector_config": ["app_id"]}},
1134+
{
1135+
"app_id": {
1136+
"type": "string",
1137+
"path_in_connector_config": ["info", "app_id"],
1138+
}
1139+
},
1140+
],
1141+
title="OAuth user input",
11441142
)
1145-
oauth_connector_input_specification: Optional[OauthConnectorInputSpecification] = (
1146-
Field(
1147-
None,
1148-
description='The DeclarativeOAuth specific blob.\nPertains to the fields defined by the connector relating to the OAuth flow.\n\nInterpolation capabilities:\n- The variables placeholders are declared as `{{my_var}}`.\n- The nested resolution variables like `{{ {{my_nested_var}} }}` is allowed as well.\n\n- The allowed interpolation context is:\n + base64Encoder - encode to `base64`, {{ {{my_var_a}}:{{my_var_b}} | base64Encoder }}\n + base64Decorer - decode from `base64` encoded string, {{ {{my_string_variable_or_string_value}} | base64Decoder }}\n + urlEncoder - encode the input string to URL-like format, {{ https://test.host.com/endpoint | urlEncoder}}\n + urlDecorer - decode the input url-encoded string into text format, {{ urlDecoder:https%3A%2F%2Fairbyte.io | urlDecoder}}\n + codeChallengeS256 - get the `codeChallenge` encoded value to provide additional data-provider specific authorisation values, {{ {{state_value}} | codeChallengeS256 }}\n\nExamples:\n - The TikTok Marketing DeclarativeOAuth spec:\n {\n "oauth_connector_input_specification": {\n "type": "object",\n "additionalProperties": false,\n "properties": {\n "consent_url": "https://ads.tiktok.com/marketing_api/auth?{{client_id_key}}={{client_id_value}}&{{redirect_uri_key}}={{ {{redirect_uri_value}} | urlEncoder}}&{{state_key}}={{state_value}}",\n "access_token_url": "https://business-api.tiktok.com/open_api/v1.3/oauth2/access_token/",\n "access_token_params": {\n "{{ auth_code_key }}": "{{ auth_code_value }}",\n "{{ client_id_key }}": "{{ client_id_value }}",\n "{{ client_secret_key }}": "{{ client_secret_value }}"\n },\n "access_token_headers": {\n "Content-Type": "application/json",\n "Accept": "application/json"\n },\n "extract_output": ["data.access_token"],\n "client_id_key": "app_id",\n "client_secret_key": "secret",\n "auth_code_key": "auth_code"\n }\n }\n }',
1149-
title="DeclarativeOAuth Connector Specification",
1150-
)
1143+
oauth_connector_input_specification: Optional[OauthConnectorInputSpecification] = Field(
1144+
None,
1145+
description='The DeclarativeOAuth specific blob.\nPertains to the fields defined by the connector relating to the OAuth flow.\n\nInterpolation capabilities:\n- The variables placeholders are declared as `{{my_var}}`.\n- The nested resolution variables like `{{ {{my_nested_var}} }}` is allowed as well.\n\n- The allowed interpolation context is:\n + base64Encoder - encode to `base64`, {{ {{my_var_a}}:{{my_var_b}} | base64Encoder }}\n + base64Decorer - decode from `base64` encoded string, {{ {{my_string_variable_or_string_value}} | base64Decoder }}\n + urlEncoder - encode the input string to URL-like format, {{ https://test.host.com/endpoint | urlEncoder}}\n + urlDecorer - decode the input url-encoded string into text format, {{ urlDecoder:https%3A%2F%2Fairbyte.io | urlDecoder}}\n + codeChallengeS256 - get the `codeChallenge` encoded value to provide additional data-provider specific authorisation values, {{ {{state_value}} | codeChallengeS256 }}\n\nExamples:\n - The TikTok Marketing DeclarativeOAuth spec:\n {\n "oauth_connector_input_specification": {\n "type": "object",\n "additionalProperties": false,\n "properties": {\n "consent_url": "https://ads.tiktok.com/marketing_api/auth?{{client_id_key}}={{client_id_value}}&{{redirect_uri_key}}={{ {{redirect_uri_value}} | urlEncoder}}&{{state_key}}={{state_value}}",\n "access_token_url": "https://business-api.tiktok.com/open_api/v1.3/oauth2/access_token/",\n "access_token_params": {\n "{{ auth_code_key }}": "{{ auth_code_value }}",\n "{{ client_id_key }}": "{{ client_id_value }}",\n "{{ client_secret_key }}": "{{ client_secret_value }}"\n },\n "access_token_headers": {\n "Content-Type": "application/json",\n "Accept": "application/json"\n },\n "extract_output": ["data.access_token"],\n "client_id_key": "app_id",\n "client_secret_key": "secret",\n "auth_code_key": "auth_code"\n }\n }\n }',
1146+
title="DeclarativeOAuth Connector Specification",
11511147
)
11521148
complete_oauth_output_specification: Optional[Dict[str, Any]] = Field(
11531149
None,
@@ -1165,9 +1161,7 @@ class Config:
11651161
complete_oauth_server_input_specification: Optional[Dict[str, Any]] = Field(
11661162
None,
11671163
description="OAuth specific blob. This is a Json Schema used to validate Json configurations persisted as Airbyte Server configurations.\nMust be a valid non-nested JSON describing additional fields configured by the Airbyte Instance or Workspace Admins to be used by the\nserver when completing an OAuth flow (typically exchanging an auth code for refresh token).\nExamples:\n complete_oauth_server_input_specification={\n client_id: {\n type: string\n },\n client_secret: {\n type: string\n }\n }",
1168-
examples=[
1169-
{"client_id": {"type": "string"}, "client_secret": {"type": "string"}}
1170-
],
1164+
examples=[{"client_id": {"type": "string"}, "client_secret": {"type": "string"}}],
11711165
title="OAuth input specification",
11721166
)
11731167
complete_oauth_server_output_specification: Optional[Dict[str, Any]] = Field(
@@ -2013,9 +2007,7 @@ class RecordSelector(BaseModel):
20132007
description="Responsible for filtering records to be emitted by the Source.",
20142008
title="Record Filter",
20152009
)
2016-
schema_normalization: Optional[
2017-
Union[SchemaNormalization, CustomSchemaNormalization]
2018-
] = Field(
2010+
schema_normalization: Optional[Union[SchemaNormalization, CustomSchemaNormalization]] = Field(
20192011
None,
20202012
description="Responsible for normalization according to the schema.",
20212013
title="Schema Normalization",
@@ -2051,12 +2043,10 @@ class DpathValidator(BaseModel):
20512043
],
20522044
title="Field Path",
20532045
)
2054-
validation_strategy: Union[ValidateAdheresToSchema, CustomValidationStrategy] = (
2055-
Field(
2056-
...,
2057-
description="The condition that the specified config value will be evaluated against",
2058-
title="Validation Strategy",
2059-
)
2046+
validation_strategy: Union[ValidateAdheresToSchema, CustomValidationStrategy] = Field(
2047+
...,
2048+
description="The condition that the specified config value will be evaluated against",
2049+
title="Validation Strategy",
20602050
)
20612051

20622052

@@ -2073,12 +2063,10 @@ class PredicateValidator(BaseModel):
20732063
],
20742064
title="Value",
20752065
)
2076-
validation_strategy: Union[ValidateAdheresToSchema, CustomValidationStrategy] = (
2077-
Field(
2078-
...,
2079-
description="The validation strategy to apply to the value.",
2080-
title="Validation Strategy",
2081-
)
2066+
validation_strategy: Union[ValidateAdheresToSchema, CustomValidationStrategy] = Field(
2067+
...,
2068+
description="The validation strategy to apply to the value.",
2069+
title="Validation Strategy",
20822070
)
20832071

20842072

@@ -2161,9 +2149,7 @@ class ConfigMigration(BaseModel):
21612149
description: Optional[str] = Field(
21622150
None, description="The description/purpose of the config migration."
21632151
)
2164-
transformations: List[
2165-
Union[ConfigRemapField, ConfigAddFields, ConfigRemoveFields]
2166-
] = Field(
2152+
transformations: List[Union[ConfigRemapField, ConfigAddFields, ConfigRemoveFields]] = Field(
21672153
...,
21682154
description="The list of transformations that will attempt to be applied on an incoming unmigrated config. The transformations will be applied in the order they are defined.",
21692155
title="Transformations",
@@ -2255,9 +2241,9 @@ class Config:
22552241

22562242
type: Literal["DeclarativeSource"]
22572243
check: Union[CheckStream, CheckDynamicStream]
2258-
streams: Optional[
2259-
List[Union[ConditionalStreams, DeclarativeStream, StateDelegatingStream]]
2260-
] = None
2244+
streams: Optional[List[Union[ConditionalStreams, DeclarativeStream, StateDelegatingStream]]] = (
2245+
None
2246+
)
22612247
dynamic_streams: List[DynamicDeclarativeStream]
22622248
version: str = Field(
22632249
...,
@@ -2382,9 +2368,7 @@ class Config:
23822368
extra = Extra.allow
23832369

23842370
type: Literal["DeclarativeStream"]
2385-
name: Optional[str] = Field(
2386-
"", description="The stream name.", example=["Users"], title="Name"
2387-
)
2371+
name: Optional[str] = Field("", description="The stream name.", example=["Users"], title="Name")
23882372
retriever: Union[SimpleRetriever, AsyncRetriever, CustomRetriever] = Field(
23892373
...,
23902374
description="Component used to coordinate how records are extracted across stream slices and request pages.",
@@ -2562,20 +2546,18 @@ class HttpRequester(BaseModelWithDeprecations):
25622546
description="Allows for retrieving a dynamic set of properties from an API endpoint which can be injected into outbound request using the stream_partition.extra_fields.",
25632547
title="Fetch Properties from Endpoint",
25642548
)
2565-
request_parameters: Optional[Union[Dict[str, Union[str, QueryProperties]], str]] = (
2566-
Field(
2567-
None,
2568-
description="Specifies the query parameters that should be set on an outgoing HTTP request given the inputs.",
2569-
examples=[
2570-
{"unit": "day"},
2571-
{
2572-
"query": 'last_event_time BETWEEN TIMESTAMP "{{ stream_interval.start_time }}" AND TIMESTAMP "{{ stream_interval.end_time }}"'
2573-
},
2574-
{"searchIn": "{{ ','.join(config.get('search_in', [])) }}"},
2575-
{"sort_by[asc]": "updated_at"},
2576-
],
2577-
title="Query Parameters",
2578-
)
2549+
request_parameters: Optional[Union[Dict[str, Union[str, QueryProperties]], str]] = Field(
2550+
None,
2551+
description="Specifies the query parameters that should be set on an outgoing HTTP request given the inputs.",
2552+
examples=[
2553+
{"unit": "day"},
2554+
{
2555+
"query": 'last_event_time BETWEEN TIMESTAMP "{{ stream_interval.start_time }}" AND TIMESTAMP "{{ stream_interval.end_time }}"'
2556+
},
2557+
{"searchIn": "{{ ','.join(config.get('search_in', [])) }}"},
2558+
{"sort_by[asc]": "updated_at"},
2559+
],
2560+
title="Query Parameters",
25792561
)
25802562
request_headers: Optional[Union[Dict[str, str], str]] = Field(
25812563
None,
@@ -2770,9 +2752,7 @@ class QueryProperties(BaseModel):
27702752

27712753
class StateDelegatingStream(BaseModel):
27722754
type: Literal["StateDelegatingStream"]
2773-
name: str = Field(
2774-
..., description="The stream name.", example=["Users"], title="Name"
2775-
)
2755+
name: str = Field(..., description="The stream name.", example=["Users"], title="Name")
27762756
full_refresh_stream: DeclarativeStream = Field(
27772757
...,
27782758
description="Component used to coordinate how records are extracted across stream slices and request pages when the state is empty or not provided.",
@@ -2861,9 +2841,7 @@ class AsyncRetriever(BaseModel):
28612841
)
28622842
download_extractor: Optional[
28632843
Union[DpathExtractor, CustomRecordExtractor, ResponseToFileExtractor]
2864-
] = Field(
2865-
None, description="Responsible for fetching the records from provided urls."
2866-
)
2844+
] = Field(None, description="Responsible for fetching the records from provided urls.")
28672845
creation_requester: Union[HttpRequester, CustomRequester] = Field(
28682846
...,
28692847
description="Requester component that describes how to prepare HTTP requests to send to the source API to create the async server-side job.",

0 commit comments

Comments
 (0)