Leitura de entidades do Twilio
Pré-requisito
Um objeto do Twilio do qual você deseja ler. Você precisará do nome do objeto, como SMS-Message ou SMS-CountryPricing.
Entidades compatíveis quanto à origem:
| Entidade | Interface | Pode ser filtrada | Oferece suporte a limite | Oferece suporte a Ordenar por | Oferece suporte a Selecionar * | Oferece suporte a particionamento |
|---|---|---|---|---|---|---|
| SMS-Message | REST | Sim | Sim | Não | Sim | Sim |
| SMS-CountryPricing | REST | Não | Não | Não | Sim | Não |
| Voice-Call | REST | Sim | Sim | Não | Sim | Não |
| Voice-Application | REST | Sim | Sim | Não | Sim | Não |
| Voice-OutgoingCallerID | REST | Sim | Sim | Não | Sim | Não |
| Voice-Queue | REST | Sim | Sim | Não | Sim | Não |
| Conversations-Conversation | REST | Sim | Sim | Não | Sim | Não |
| Conversations-User | REST | Não | Sim | Não | Sim | Não |
| Conversas-Função | REST | Não | Sim | Não | Sim | Não |
| Conversations-Configuration | REST | Não | Não | Não | Sim | Não |
| Conversations-AddressConfiguration | REST | Sim | Sim | Não | Sim | Não |
| Conversations-WebhookConfiguration | REST | Não | Não | Não | Sim | Não |
| Conversations-ParticipantConversation | REST | Não | Não | Não | Sim | Não |
| Conversations-Credential | REST | Não | Sim | Não | Sim | Não |
| Conversations-ConversationService | REST | Não | Sim | Não | Sim | Não |
Exemplo:
twilio_read = glueContext.create_dynamic_frame.from_options( connection_type="twilio", connection_options={ "connectionName": "connectionName", "ENTITY_NAME": "sms-message", "API_VERSION": "2010-04-01", "Edge_Location": "sydney.us1" }
Detalhes de entidade e campo do Twilio:
| Entidade | Campo | Tipo de dados | Operadores compatíveis |
|---|---|---|---|
| SMS-Message | account_sid | String | N/D |
| api_version | String | N/D | |
| body | String | N/D | |
| date_created | Datetime | N/D | |
| date_sent | Datetime | >=, <=, = | |
| date_updated | Datetime | N/D | |
| direction | String | N/D | |
| error_code | Inteiro | N/D | |
| error_message | String | N/D | |
| from | Inteiro | = | |
| messaging_service_sid | String | N/D | |
| num_media | String | N/D | |
| num_segments | String | N/D | |
| preço | String | N/D | |
| price_unit | Struct | N/D | |
| sid | Inteiro | N/D | |
| status | String | N/D | |
| subresource_uris | Mapa | N/D | |
| com | Inteiro | = | |
| uri | Datetime | N/D | |
| SMS-CountryPricing | country | String | N/D |
| iso_country | String | N/D | |
| url | String | N/D | |
| outbound_sms_prices | Lista | N/D | |
| inbound_sms_prices | Lista | N/D | |
| price_unit | String | N/D | |
| Voice-Call | account_sid | String | N/D |
| anotação | String | N/D | |
| answered_by | String | N/D | |
| api_version | String | N/D | |
| caller_name | String | N/D | |
| date_created | Datetime | N/D | |
| date_updated | Datetime | N/D | |
| direction | String | N/D | |
| duration | String | N/D | |
| end_time | Datetime | >=, <=, = | |
| forwarded_from | String | N/D | |
| from | String | = | |
| from_formatted | String | N/D | |
| group_sid | String | N/D | |
| parent_call_sid | String | N/D | |
| phone_number_sid | String | N/D | |
| preço | String | N/D | |
| price_unit | String | N/D | |
| sid | String | N/D | |
| start_time | Datetime | >=, <=, = | |
| status | String | = | |
| subresource_uris | String | N/D | |
| com | String | = | |
| to_formatted | String | N/D | |
| trunk_sid | String | N/D | |
| uri | String | N/D | |
| queue_time | String | N/D | |
| Voice-Application | account_sid | String | N/D |
| api_version | String | N/D | |
| date_created | Datetime | N/D | |
| date_updated | Datetime | N/D | |
| friendly_name | String | = | |
| message_status_callback | String | N/D | |
| sid | String | N/D | |
| sms_fallback_method | String | N/D | |
| sms_fallback_url | String | N/D | |
| sms_method | String | N/D | |
| sms_status_callback | String | N/D | |
| sms_url | String | N/D | |
| status_callback | String | N/D | |
| status_callback_method | String | N/D | |
| uri | String | N/D | |
| voice_caller_id_lookup | Booleano | N/D | |
| voice_fallback_method | String | N/D | |
| voice_fallback_url | String | N/D | |
| método_voz | String | N/D | |
| voice_url | String | N/D | |
| public_application_connect_enabled | Booleano | N/D | |
| Voice-OutgoingCallerID | sid | String | N/D |
| date_created | Datetime | N/D | |
| date_updated | Datetime | N/D | |
| account_sid | String | N/D | |
| friendly_name | String | = | |
| phone_number | String | = | |
| uri | String | N/D | |
| Voice-Queue | date_created | Datetime | N/D |
| date_updated | Datetime | N/D | |
| current_size | Inteiro | N/D | |
| friendly_name | String | N/D | |
| uri | String | N/D | |
| account_sid | String | N/D | |
| average_wait_time | Inteiro | N/D | |
| sid | String | N/D | |
| max_size | Inteiro | N/D | |
| Conversations-Conversation | account_sid | String | N/D |
| chat_service_sid | String | N/D | |
| messaging_service_sid | String | N/D | |
| sid | String | N/D | |
| friendly_name | String | N/D | |
| unique_name | String | N/D | |
| attributes | String | N/D | |
| estado | String | = | |
| date_created | Datetime | N/D | |
| date_updated | Datetime | N/D | |
| timers | Struct | N/D | |
| url | String | N/D | |
| links | Struct | N/D | |
| bindings | Struct | N/D | |
| start_date | Datetime | = | |
| end_date | Datetime | = | |
| Timers.DateInactive | String | N/D | |
| Timers.DateClosed | String | N/D | |
| Conversations-User | sid | String | N/D |
| account_sid | String | N/D | |
| chat_service_sid | String | N/D | |
| role_sid | String | N/D | |
| identidade | String | N/D | |
| friendly_name | String | N/D | |
| attributes | String | N/D | |
| is_online | Booleano | N/D | |
| is_notifiable | Booleano | N/D | |
| date_created | Datetime | N/D | |
| date_updated | Datetime | N/D | |
| url | String | N/D | |
| links | Struct | N/D | |
| Conversations-Role | sid | String | N/D |
| account_sid | String | N/D | |
| chat_service_sid | String | N/D | |
| friendly_name | String | N/D | |
| type | String | N/D | |
| permissões | String | N/D | |
| date_created | Datetime | N/D | |
| date_updated | Datetime | N/D | |
| url | String | N/D | |
| Conversations-Configuration | account_sid | Longo | N/D |
| default_chat_service_sid | String | N/D | |
| default_messaging_service_sid | String | N/D | |
| default_inactive_timer | String | N/D | |
| default_closed_timer | String | N/D | |
| url | String | N/D | |
| links | Mapa | N/D | |
| Conversations-AddressConfiguration | sid | String | N/D |
| account_sid | String | N/D | |
| type | String | N/D | |
| address | String | N/D | |
| friendly_name | String | N/D | |
| auto_creation | Struct | N/D | |
| date_created | Datetime | N/D | |
| date_updated | Datetime | N/D | |
| url | String | N/D | |
| address_country | String | N/D | |
| AutoCreation.Enabled | Booleano | N/D | |
| AutoCreation.Type | String | N/D | |
| AutoCreation.ConversationServiceSid | String | N/D | |
| AutoCreation.WebhookUrl | String | N/D | |
| AutoCreation.WebhookMethod | String | N/D | |
| AutoCreation.WebhookFilters | Lista | N/D | |
| AutoCreation.StudioFlowSid | String | N/D | |
| AutoCreation.StudioRetryCount | Inteiro | N/D | |
| Conversations-WebhookConfiguration | account_sid | String | N/D |
| method | String | N/D | |
| filtros | Lista | N/D | |
| pre_webhook_url | String | N/D | |
| post_webhook_url | String | N/D | |
| target | String | N/D | |
| url | String | N/D | |
| Converations-ParticipantConversation | account_sid | String | N/D |
| chat_service_sid | String | N/D | |
| participant_sid | String | N/D | |
| participant_user_sid | String | N/D | |
| participant_identity | String | N/D | |
| participant_messaging_binding | Struct | N/D | |
| Conversation_sid | String | N/D | |
| conversation_unique_name | String | N/D | |
| conversation_friendly_name | String | N/D | |
| conversation_attributes | String | N/D | |
| conversation_date_created | Datetime | N/D | |
| conversation_date_updated | Datetime | N/D | |
| conversation_created_by | String | N/D | |
| conversation_state | String | N/D | |
| conversation_timers | Struct | N/D | |
| links | Mapa | N/D | |
| address | String | = | |
| identidade | String | = | |
| Conversation-Credentials | sid | String | N/D |
| account_sid | String | N/D | |
| friendly_name | String | N/D | |
| type | String | N/D | |
| sandbox | String | N/D | |
| date_created | Datetime | N/D | |
| dated_updated | Datetime | N/D | |
| url | String | N/D | |
| certificado | String | N/D | |
| private_key | String | N/D | |
| api_key | String | N/D | |
| secret | String | N/D | |
| Conversations-ConversationService | sid | String | N/D |
| account_sid | String | N/D | |
| friendly_name | String | N/D | |
| date_created | Datetime | N/D | |
| date_updated | Datetime | N/D | |
| url | String | N/D | |
| links | Mapa | N/D |
Particionamento de consultas
Campos com suporte a particionamento:
No Twilio, os campos de tipo de dados DateTime oferecem suporte ao particionamento baseado em campos.
É possível fornecer as opções adicionais do Spark PARTITION_FIELD, LOWER_BOUND, UPPER_BOUND e NUM_PARTITIONS se quiser utilizar a simultaneidade no Spark. Com esses parâmetros, a consulta original seria dividida em NUM_PARTITIONS subconsultas, que poderiam ser executadas pelas tarefas do Spark simultaneamente.
PARTITION_FIELD: o nome do campo a ser usado para particionar a consulta.LOWER_BOUND: um valor limite inferior inclusivo do campo de partição escolhido.No campo Datetime, aceitamos o formato de carimbo de data/hora do Spark usado em consultas SQL do Spark.
Exemplos de valores válidos:
"2024-05-01T20:55:02.000Z"UPPER_BOUND: um valor limite superior exclusivo do campo de partição escolhido.NUM_PARTITIONS: o número de partições.
Exemplo:
twilio_read = glueContext.create_dynamic_frame.from_options( connection_type="twilio", connection_options={ "connectionName": "connectionName", "ENTITY_NAME": "sms-message", "API_VERSION": "2010-04-01", "PARTITION_FIELD": "date_sent" "LOWER_BOUND": "2024-05-01T20:55:02.000Z" "UPPER_BOUND": "2024-06-01T20:55:02.000Z" "NUM_PARTITIONS": "10" }