Skip to content

Commit

Permalink
Accounts and Addresses streams migration to low code
Browse files Browse the repository at this point in the history
  • Loading branch information
cristina.mariscal authored and cristina.mariscal committed Jun 25, 2024
1 parent c7cebfc commit eb7382d
Show file tree
Hide file tree
Showing 9 changed files with 689 additions and 217 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: b9dc6155-672e-42ea-b10d-9f1f1fb95ab1
dockerImageTag: 0.11.6
dockerImageTag: 0.11.7
dockerRepository: airbyte/source-twilio
documentationUrl: https://docs.airbyte.com/integrations/sources/twilio
githubIssueLabel: source-twilio
Expand Down
330 changes: 312 additions & 18 deletions airbyte-integrations/connectors/source-twilio/poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions airbyte-integrations/connectors/source-twilio/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
version = "0.11.6"
version = "0.11.7"
name = "source-twilio"
description = "Source implementation for Twilio."
authors = [ "Airbyte <[email protected]>",]
Expand All @@ -17,7 +17,7 @@ include = "source_twilio"

[tool.poetry.dependencies]
python = "^3.9,<3.12"
airbyte-cdk = "0.80.0"
airbyte-cdk = "^1"
pendulum = "==2.1.2"
requests = "==2.31.0"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,365 @@
version: 1.3.1

type: DeclarativeSource

check:
type: CheckStream
stream_names:
- Accounts

definitions:
base_requester:
type: HttpRequester
url_base: https://
authenticator:
type: BasicHttpAuthenticator
password: '{{ config["auth_token"] }}'
username: '{{ config["account_sid"] }}'
streams:
Accounts:
type: DeclarativeStream
name: Accounts
primary_key:
- sid
retriever:
type: SimpleRetriever
requester:
$ref: "#/definitions/base_requester"
path: https://api.twilio.com/2010-04-01/Accounts.json
http_method: GET
record_selector:
type: RecordSelector
extractor:
type: DpathExtractor
field_path:
- accounts
schema_loader:
type: InlineSchemaLoader
schema:
$ref: "#/schemas/Accounts"
Addresses:
type: DeclarativeStream
name: Addresses
primary_key:
- sid
retriever:
type: SimpleRetriever
requester:
$ref: "#/definitions/base_requester"
path: >-
{{ config['base_api_url'] }}/Accounts/{{
stream_partition.account_sid }}/Addresses.json
http_method: GET
record_selector:
type: RecordSelector
extractor:
type: DpathExtractor
field_path:
- addresses
paginator:
type: DefaultPaginator
page_token_option:
type: RequestOption
inject_into: request_parameter
field_name: Page
page_size_option:
type: RequestOption
field_name: PageSize
inject_into: request_parameter
pagination_strategy:
type: PageIncrement
page_size: 1000
start_from_page: 0
partition_router:
type: SubstreamPartitionRouter
parent_stream_configs:
- type: ParentStreamConfig
parent_key: sid
partition_field: account_sid
stream:
$ref: "#/definitions/streams/Accounts"
schema_loader:
type: InlineSchemaLoader
schema:
$ref: "#/schemas/Addresses"

streams:
- $ref: "#/definitions/streams/Accounts"
- $ref: "#/definitions/streams/Addresses"

spec:
type: Spec
connection_specification:
type: object
$schema: http://json-schema.org/draft-07/schema#
required:
- username
- base_api_url
- studio_base_api_url
- start_date
properties:
username:
type: string
order: 0
title: Username
password:
type: string
order: 1
title: Password
always_show: true
airbyte_secret: true
base_api_url:
type: string
order: 2
title: Base API URL
default: api.twilio.com/2010-04-01/
studio_base_api_url:
type: string
order: 3
title: Studio Base API URL
default: studio.twilio.com/v1/
description: Studio Base API URL
start_date:
type: string
title: Start date
format: date-time
pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$
order: 4
additionalProperties: true

metadata:
autoImportSchema:
Accounts: true
Addresses: true

schemas:
Accounts:
type: object
$schema: http://json-schema.org/schema#
additionalProperties: true
properties:
auth_token:
description: The authentication token for the account
type:
- 'null'
- string
date_created:
description: The timestamp when the account was created
format: date-time
type:
- 'null'
- string
date_updated:
description: The timestamp when the account was last updated
format: date-time
type:
- 'null'
- string
friendly_name:
description: A user-defined friendly name for the account
type:
- 'null'
- string
owner_account_sid:
description: The SID of the owner account
type:
- 'null'
- string
sid:
description: The unique identifier for the account
type:
- 'null'
- string
status:
description: The current status of the account
type:
- 'null'
- string
subresource_uris:
additionalProperties: true
description: URIs for accessing various subresources related to the account
properties:
addresses:
type:
- 'null'
- string
applications:
type:
- 'null'
- string
authorized_connect_apps:
type:
- 'null'
- string
available_phone_numbers:
type:
- 'null'
- string
balance:
type:
- 'null'
- string
calls:
type:
- 'null'
- string
conferences:
type:
- 'null'
- string
connect_apps:
type:
- 'null'
- string
incoming_phone_numbers:
type:
- 'null'
- string
keys:
type:
- 'null'
- string
messages:
type:
- 'null'
- string
notifications:
type:
- 'null'
- string
outgoing_caller_ids:
type:
- 'null'
- string
queues:
type:
- 'null'
- string
recordings:
type:
- 'null'
- string
short_codes:
type:
- 'null'
- string
signing_keys:
type:
- 'null'
- string
sip:
type:
- 'null'
- string
transcriptions:
type:
- 'null'
- string
usage:
type:
- 'null'
- string
type:
- 'null'
- object
type:
description: The type of the account
type:
- 'null'
- string
uri:
description: The URI for accessing the account resource
type:
- 'null'
- string
required:
- sid
Addresses:
type: object
$schema: http://json-schema.org/schema#
additionalProperties: true
properties:
account_sid:
description: The unique identifier of the account associated with this address.
type:
- 'null'
- string
city:
description: The city of the address.
type:
- 'null'
- string
customer_name:
description: The name of the customer associated with this address.
type:
- 'null'
- string
date_created:
description: The date and time when the address was created.
format: date-time
type:
- 'null'
- string
date_updated:
description: The date and time when the address was last updated.
format: date-time
type:
- 'null'
- string
emergency_enabled:
description: Indicates whether emergency services are enabled for this address.
type:
- 'null'
- boolean
friendly_name:
description: A friendly name or label for the address.
type:
- 'null'
- string
iso_country:
description: The ISO 3166-1 alpha-2 country code of the address.
type:
- 'null'
- string
postal_code:
description: The postal code of the address.
type:
- 'null'
- string
region:
description: The region or state of the address.
type:
- 'null'
- string
sid:
description: The unique identifier of the address.
type:
- 'null'
- string
street:
description: The street address.
type:
- 'null'
- string
street_secondary:
description: Additional information about the street address, such as suite number.
type:
- 'null'
- string
uri:
description: The URI of the address resource.
type:
- 'null'
- string
validated:
description: Indicates whether the address has been validated.
type:
- 'null'
- boolean
verified:
description: Indicates whether the address has been verified.
type:
- 'null'
- boolean
required:
- sid
Loading

0 comments on commit eb7382d

Please sign in to comment.