272 lines
7.3 KiB
YAML
272 lines
7.3 KiB
YAML
version: 4.5.4
|
|
|
|
type: DeclarativeSource
|
|
|
|
check:
|
|
type: CheckStream
|
|
stream_names:
|
|
- workspaces
|
|
|
|
definitions:
|
|
streams:
|
|
workspaces:
|
|
type: DeclarativeStream
|
|
name: workspaces
|
|
primary_key:
|
|
- sid
|
|
retriever:
|
|
type: SimpleRetriever
|
|
requester:
|
|
$ref: "#/definitions/base_requester"
|
|
path: /v1/Workspaces
|
|
http_method: GET
|
|
record_selector:
|
|
type: RecordSelector
|
|
extractor:
|
|
type: DpathExtractor
|
|
field_path:
|
|
- workspaces
|
|
paginator:
|
|
type: DefaultPaginator
|
|
page_token_option:
|
|
type: RequestPath
|
|
page_size_option:
|
|
type: RequestOption
|
|
inject_into: request_parameter
|
|
field_name: PageSize
|
|
pagination_strategy:
|
|
type: CursorPagination
|
|
page_size: 50
|
|
cursor_value: "{{response['meta']['next_page_url']}}"
|
|
schema_loader:
|
|
type: InlineSchemaLoader
|
|
schema:
|
|
$ref: "#/schemas/workspaces"
|
|
workers:
|
|
type: DeclarativeStream
|
|
name: workers
|
|
primary_key:
|
|
- sid
|
|
retriever:
|
|
type: SimpleRetriever
|
|
requester:
|
|
$ref: "#/definitions/base_requester"
|
|
path: /v1/Workspaces/{{ stream_slice.id }}/Workers
|
|
http_method: GET
|
|
record_selector:
|
|
type: RecordSelector
|
|
extractor:
|
|
type: DpathExtractor
|
|
field_path:
|
|
- workers
|
|
paginator:
|
|
type: DefaultPaginator
|
|
page_token_option:
|
|
type: RequestPath
|
|
page_size_option:
|
|
type: RequestOption
|
|
inject_into: request_parameter
|
|
field_name: PageSize
|
|
pagination_strategy:
|
|
type: CursorPagination
|
|
page_size: 50
|
|
cursor_value: "{{response['meta']['next_page_url']}}"
|
|
partition_router:
|
|
type: SubstreamPartitionRouter
|
|
parent_stream_configs:
|
|
- type: ParentStreamConfig
|
|
parent_key: sid
|
|
partition_field: id
|
|
stream:
|
|
$ref: "#/definitions/streams/workspaces"
|
|
schema_loader:
|
|
type: InlineSchemaLoader
|
|
schema:
|
|
$ref: "#/schemas/workers"
|
|
base_requester:
|
|
type: HttpRequester
|
|
url_base: https://taskrouter.twilio.com
|
|
authenticator:
|
|
type: BasicHttpAuthenticator
|
|
username: '{{ config["account_sid"] }}'
|
|
password: '{{ config["auth_token"] }}'
|
|
|
|
streams:
|
|
- $ref: "#/definitions/streams/workspaces"
|
|
- $ref: "#/definitions/streams/workers"
|
|
|
|
spec:
|
|
type: Spec
|
|
connection_specification:
|
|
type: object
|
|
$schema: http://json-schema.org/draft-07/schema#
|
|
required:
|
|
- account_sid
|
|
- auth_token
|
|
properties:
|
|
account_sid:
|
|
type: string
|
|
description: Twilio Account ID
|
|
title: Account SID
|
|
airbyte_secret: true
|
|
order: 0
|
|
auth_token:
|
|
type: string
|
|
description: Twilio Auth Token
|
|
airbyte_secret: true
|
|
title: Auth Token
|
|
order: 1
|
|
additionalProperties: true
|
|
|
|
schemas:
|
|
workspaces:
|
|
type: object
|
|
additionalProperties: true
|
|
properties:
|
|
account_sid:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: The unique identifier for the account associated with the workspace.
|
|
date_created:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: The date and time when the workspace was created.
|
|
format: date-time
|
|
date_updated:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: The date and time when the workspace was last updated.
|
|
format: date-time
|
|
default_acitvity_name:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: The name of the default activity for the workspace.
|
|
default_activity_sid:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: The unique identifier for the default activity of the workspace.
|
|
event_callback_url:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: The URL to which taskrouter events will be sent.
|
|
events_filter:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: Filter for specifying which events should be sent to the callback URL.
|
|
friendly_name:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: A user-friendly name for the workspace.
|
|
links:
|
|
type:
|
|
- "null"
|
|
- object
|
|
description: Links related to the workspace.
|
|
multi_task_enabled:
|
|
type:
|
|
- "null"
|
|
- boolean
|
|
description: Indicates whether multitasking is enabled for the workspace.
|
|
sid:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: The unique identifier for the workspace.
|
|
timeout_activity_sid:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: >-
|
|
The unique identifier for the activity that tasks are routed to on
|
|
timeout.
|
|
timeout_actvity_name:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: The name of the activity that tasks are routed to on timeout.
|
|
url:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: The URL of the workspace.
|
|
workers:
|
|
type: object
|
|
additionalProperties: true
|
|
properties:
|
|
account_sid:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: The unique identifier for the account that this worker belongs to.
|
|
activity_sid:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: The unique identifier of the current activity of the worker.
|
|
actvity_name:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: The name of the current activity of the worker.
|
|
attributes:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: Custom attributes or metadata associated with the worker.
|
|
available:
|
|
type:
|
|
- "null"
|
|
- boolean
|
|
description: Indicates if the worker is available for tasks.
|
|
date_created:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: The date and time when the worker was created.
|
|
format: date-time
|
|
date_status_changed:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: The date and time when the worker's status was last changed.
|
|
format: date-time
|
|
date_updated:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: The date and time when the worker was last updated.
|
|
format: date-time
|
|
friendly_name:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: A friendly name or label for the worker.
|
|
links:
|
|
type:
|
|
- "null"
|
|
- object
|
|
description: Related resource URIs for the worker.
|
|
sid:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: The unique identifier for the worker.
|
|
url:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: The resource URL for accessing details of the worker.
|
|
workspace_sid:
|
|
type:
|
|
- "null"
|
|
- string
|
|
description: The unique identifier for the workspace that this worker belongs to.
|