blujay 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- blujay/__init__.py +1198 -0
- blujay/_default_clients.py +30 -0
- blujay/_errors.py +105 -0
- blujay/_version.py +2 -0
- blujay/attachments/__init__.py +40 -0
- blujay/attachments/client.py +374 -0
- blujay/attachments/raw_client.py +1058 -0
- blujay/attachments/types/__init__.py +38 -0
- blujay/attachments/types/attachment_create_response.py +30 -0
- blujay/attachments/types/attachment_get_response.py +30 -0
- blujay/calls/__init__.py +4 -0
- blujay/calls/client.py +113 -0
- blujay/calls/raw_client.py +263 -0
- blujay/capability/__init__.py +36 -0
- blujay/capability/client.py +152 -0
- blujay/capability/raw_client.py +302 -0
- blujay/capability/types/__init__.py +34 -0
- blujay/capability/types/capability_evaluate_service_response.py +30 -0
- blujay/chats/__init__.py +72 -0
- blujay/chats/client.py +848 -0
- blujay/chats/messages/__init__.py +40 -0
- blujay/chats/messages/client.py +336 -0
- blujay/chats/messages/raw_client.py +652 -0
- blujay/chats/messages/types/__init__.py +38 -0
- blujay/chats/messages/types/chat_message_list_response.py +30 -0
- blujay/chats/messages/types/chat_message_send_response.py +30 -0
- blujay/chats/participants/__init__.py +42 -0
- blujay/chats/participants/client.py +355 -0
- blujay/chats/participants/raw_client.py +817 -0
- blujay/chats/participants/types/__init__.py +40 -0
- blujay/chats/participants/types/chat_participant_add_response.py +30 -0
- blujay/chats/participants/types/chat_participant_list_response.py +30 -0
- blujay/chats/participants/types/chat_participant_remove_response.py +30 -0
- blujay/chats/raw_client.py +1913 -0
- blujay/chats/types/__init__.py +44 -0
- blujay/chats/types/chat_create_response.py +30 -0
- blujay/chats/types/chat_get_response.py +30 -0
- blujay/chats/types/chat_leave_response.py +30 -0
- blujay/chats/types/chat_list_response.py +30 -0
- blujay/chats/types/chat_update_response.py +30 -0
- blujay/chats/typing/__init__.py +4 -0
- blujay/chats/typing/client.py +186 -0
- blujay/chats/typing/raw_client.py +453 -0
- blujay/client.py +426 -0
- blujay/contacts/__init__.py +87 -0
- blujay/contacts/client.py +1336 -0
- blujay/contacts/notes/__init__.py +40 -0
- blujay/contacts/notes/client.py +248 -0
- blujay/contacts/notes/raw_client.py +549 -0
- blujay/contacts/notes/types/__init__.py +38 -0
- blujay/contacts/notes/types/contact_note_create_response.py +30 -0
- blujay/contacts/notes/types/contact_note_list_response.py +30 -0
- blujay/contacts/raw_client.py +3005 -0
- blujay/contacts/types/__init__.py +74 -0
- blujay/contacts/types/contact_add_tag_response.py +30 -0
- blujay/contacts/types/contact_assign_response.py +30 -0
- blujay/contacts/types/contact_create_response.py +30 -0
- blujay/contacts/types/contact_get_response.py +30 -0
- blujay/contacts/types/contact_list_response.py +30 -0
- blujay/contacts/types/contact_mark_completed_response.py +30 -0
- blujay/contacts/types/contact_opt_out_address_response.py +30 -0
- blujay/contacts/types/contact_opt_out_response.py +30 -0
- blujay/contacts/types/contact_remove_opt_out_response.py +30 -0
- blujay/contacts/types/contact_search_response.py +30 -0
- blujay/contacts/types/contact_stage.py +5 -0
- blujay/contacts/types/contact_update_response.py +30 -0
- blujay/contacts/types/contact_upsert_response.py +30 -0
- blujay/core/__init__.py +139 -0
- blujay/core/api_error.py +62 -0
- blujay/core/client_wrapper.py +146 -0
- blujay/core/datetime_utils.py +70 -0
- blujay/core/file.py +67 -0
- blujay/core/force_multipart.py +18 -0
- blujay/core/http_client.py +1021 -0
- blujay/core/http_response.py +63 -0
- blujay/core/http_sse/__init__.py +42 -0
- blujay/core/http_sse/_api.py +455 -0
- blujay/core/http_sse/_decoders.py +74 -0
- blujay/core/http_sse/_exceptions.py +7 -0
- blujay/core/http_sse/_models.py +17 -0
- blujay/core/jsonable_encoder.py +145 -0
- blujay/core/logging.py +107 -0
- blujay/core/pagination.py +167 -0
- blujay/core/parse_error.py +36 -0
- blujay/core/pydantic_utilities.py +540 -0
- blujay/core/query_encoder.py +58 -0
- blujay/core/remove_none_from_dict.py +11 -0
- blujay/core/request_options.py +41 -0
- blujay/core/serialization.py +349 -0
- blujay/core/unchecked_base_model.py +505 -0
- blujay/environment.py +7 -0
- blujay/errors/__init__.py +71 -0
- blujay/errors/bad_gateway_error.py +11 -0
- blujay/errors/bad_request_error.py +11 -0
- blujay/errors/conflict_error.py +11 -0
- blujay/errors/content_too_large_error.py +11 -0
- blujay/errors/forbidden_error.py +11 -0
- blujay/errors/internal_server_error.py +11 -0
- blujay/errors/not_found_error.py +11 -0
- blujay/errors/service_unavailable_error.py +11 -0
- blujay/errors/too_many_requests_error.py +11 -0
- blujay/errors/unauthorized_error.py +11 -0
- blujay/errors/unprocessable_entity_error.py +11 -0
- blujay/errors/unsupported_media_type_error.py +11 -0
- blujay/me/__init__.py +34 -0
- blujay/me/client.py +100 -0
- blujay/me/raw_client.py +192 -0
- blujay/me/types/__init__.py +34 -0
- blujay/me/types/me_get_response.py +30 -0
- blujay/messages/__init__.py +69 -0
- blujay/messages/client.py +647 -0
- blujay/messages/raw_client.py +1406 -0
- blujay/messages/reactions/__init__.py +40 -0
- blujay/messages/reactions/client.py +315 -0
- blujay/messages/reactions/raw_client.py +741 -0
- blujay/messages/reactions/types/__init__.py +38 -0
- blujay/messages/reactions/types/message_reaction_add_response.py +30 -0
- blujay/messages/reactions/types/message_reaction_remove_response.py +30 -0
- blujay/messages/types/__init__.py +56 -0
- blujay/messages/types/message_edit_response.py +30 -0
- blujay/messages/types/message_get_response.py +30 -0
- blujay/messages/types/message_include.py +5 -0
- blujay/messages/types/message_list_response.py +30 -0
- blujay/messages/types/message_list_thread_order.py +5 -0
- blujay/messages/types/message_list_thread_response.py +30 -0
- blujay/messages/types/message_unsend_response.py +30 -0
- blujay/phone_numbers/__init__.py +54 -0
- blujay/phone_numbers/client.py +203 -0
- blujay/phone_numbers/contact_card/__init__.py +46 -0
- blujay/phone_numbers/contact_card/client.py +402 -0
- blujay/phone_numbers/contact_card/raw_client.py +1065 -0
- blujay/phone_numbers/contact_card/types/__init__.py +44 -0
- blujay/phone_numbers/contact_card/types/phone_number_contact_card_delete_response.py +30 -0
- blujay/phone_numbers/contact_card/types/phone_number_contact_card_get_response.py +30 -0
- blujay/phone_numbers/contact_card/types/phone_number_contact_card_set_response.py +30 -0
- blujay/phone_numbers/raw_client.py +396 -0
- blujay/phone_numbers/types/__init__.py +38 -0
- blujay/phone_numbers/types/phone_number_get_response.py +30 -0
- blujay/phone_numbers/types/phone_number_list_response.py +30 -0
- blujay/py.typed +0 -0
- blujay/requests/__init__.py +97 -0
- blujay/requests/audio_part.py +18 -0
- blujay/requests/bubble_effect.py +10 -0
- blujay/requests/chat_icon_input.py +11 -0
- blujay/requests/link_part.py +13 -0
- blujay/requests/media_part.py +18 -0
- blujay/requests/message_effect.py +8 -0
- blujay/requests/message_input.py +33 -0
- blujay/requests/message_part.py +11 -0
- blujay/requests/message_reply_to.py +26 -0
- blujay/requests/screen_effect.py +10 -0
- blujay/requests/text_decoration.py +19 -0
- blujay/requests/text_part.py +16 -0
- blujay/requests/vcard_email_input.py +9 -0
- blujay/requests/vcard_part.py +14 -0
- blujay/requests/vcard_phone_input.py +13 -0
- blujay/requests/webhook_phone_number_filter.py +21 -0
- blujay/requests/workflow_metadata.py +10 -0
- blujay/requests/workflow_metadata_value.py +5 -0
- blujay/team_members/__init__.py +36 -0
- blujay/team_members/client.py +104 -0
- blujay/team_members/raw_client.py +196 -0
- blujay/team_members/types/__init__.py +34 -0
- blujay/team_members/types/team_member_list_assignable_response.py +30 -0
- blujay/types/__init__.py +896 -0
- blujay/types/accepted_chat_leave.py +27 -0
- blujay/types/accepted_chat_leave_operation.py +5 -0
- blujay/types/accepted_chat_leave_status.py +5 -0
- blujay/types/accepted_chat_metadata_mutation.py +39 -0
- blujay/types/accepted_chat_metadata_mutation_operation.py +7 -0
- blujay/types/accepted_chat_metadata_mutation_status.py +5 -0
- blujay/types/accepted_group_participant_mutation.py +33 -0
- blujay/types/accepted_group_participant_mutation_operation.py +7 -0
- blujay/types/accepted_group_participant_mutation_participant.py +24 -0
- blujay/types/accepted_group_participant_mutation_participant_status.py +5 -0
- blujay/types/accepted_group_participant_mutation_participant_type.py +5 -0
- blujay/types/accepted_group_participant_mutation_status.py +7 -0
- blujay/types/accepted_message.py +23 -0
- blujay/types/accepted_message_reaction.py +35 -0
- blujay/types/accepted_message_reaction_operation.py +5 -0
- blujay/types/accepted_message_reaction_reaction.py +27 -0
- blujay/types/accepted_message_reaction_status.py +5 -0
- blujay/types/api_key_credential.py +24 -0
- blujay/types/api_key_credential_status.py +5 -0
- blujay/types/api_key_credential_type.py +5 -0
- blujay/types/api_key_summary.py +22 -0
- blujay/types/api_key_summary_status.py +5 -0
- blujay/types/assignable_team_member_list.py +21 -0
- blujay/types/assigned_team_member.py +23 -0
- blujay/types/attachment.py +30 -0
- blujay/types/attachment_id.py +3 -0
- blujay/types/attachment_status.py +5 -0
- blujay/types/attachment_upload.py +35 -0
- blujay/types/attachment_upload_upload_headers.py +31 -0
- blujay/types/audio_output_part.py +34 -0
- blujay/types/audio_output_part_type.py +5 -0
- blujay/types/audio_part.py +31 -0
- blujay/types/audio_part_type.py +5 -0
- blujay/types/bubble_effect.py +23 -0
- blujay/types/bubble_effect_name.py +5 -0
- blujay/types/bubble_effect_type.py +5 -0
- blujay/types/call_ended_webhook_data.py +87 -0
- blujay/types/call_ended_webhook_data_direction.py +5 -0
- blujay/types/call_ended_webhook_data_outcome.py +7 -0
- blujay/types/call_ended_webhook_data_type.py +5 -0
- blujay/types/call_ended_webhook_event.py +47 -0
- blujay/types/call_ended_webhook_event_api_version.py +5 -0
- blujay/types/call_id.py +3 -0
- blujay/types/call_recording_ready_webhook_data.py +94 -0
- blujay/types/call_recording_ready_webhook_data_direction.py +5 -0
- blujay/types/call_recording_ready_webhook_data_outcome.py +7 -0
- blujay/types/call_recording_ready_webhook_data_recording.py +30 -0
- blujay/types/call_recording_ready_webhook_data_recording_kind.py +5 -0
- blujay/types/call_recording_ready_webhook_data_summary.py +26 -0
- blujay/types/call_recording_ready_webhook_data_summary_status.py +5 -0
- blujay/types/call_recording_ready_webhook_data_transcript.py +26 -0
- blujay/types/call_recording_ready_webhook_data_transcript_status.py +5 -0
- blujay/types/call_recording_ready_webhook_data_type.py +5 -0
- blujay/types/call_recording_ready_webhook_event.py +47 -0
- blujay/types/call_recording_ready_webhook_event_api_version.py +5 -0
- blujay/types/capability_service_result.py +42 -0
- blujay/types/capability_service_result_service.py +5 -0
- blujay/types/capability_service_result_source.py +5 -0
- blujay/types/chat.py +66 -0
- blujay/types/chat_icon.py +28 -0
- blujay/types/chat_icon_input.py +24 -0
- blujay/types/chat_id.py +3 -0
- blujay/types/chat_list.py +24 -0
- blujay/types/chat_participant.py +8 -0
- blujay/types/chat_service.py +5 -0
- blujay/types/chat_type.py +5 -0
- blujay/types/contact.py +66 -0
- blujay/types/contact_assignment_action_result.py +66 -0
- blujay/types/contact_card_profile.py +52 -0
- blujay/types/contact_card_profile_photo.py +26 -0
- blujay/types/contact_card_profile_photo_content_type.py +5 -0
- blujay/types/contact_card_profile_status.py +5 -0
- blujay/types/contact_id.py +3 -0
- blujay/types/contact_list.py +24 -0
- blujay/types/contact_note.py +39 -0
- blujay/types/contact_note_list.py +24 -0
- blujay/types/contact_note_source.py +5 -0
- blujay/types/contact_search_result.py +21 -0
- blujay/types/contact_stage_action_result.py +66 -0
- blujay/types/contact_suppression.py +27 -0
- blujay/types/contact_suppression_address_type.py +5 -0
- blujay/types/contact_tag_action_result.py +66 -0
- blujay/types/direct_chat_participant.py +37 -0
- blujay/types/direct_chat_participant_type.py +5 -0
- blujay/types/error_envelope.py +35 -0
- blujay/types/error_envelope_status.py +5 -0
- blujay/types/error_object.py +64 -0
- blujay/types/event_id.py +3 -0
- blujay/types/generic_webhook_event.py +46 -0
- blujay/types/generic_webhook_event_api_version.py +5 -0
- blujay/types/group_name_webhook_data.py +26 -0
- blujay/types/group_name_webhook_event.py +47 -0
- blujay/types/group_name_webhook_event_api_version.py +5 -0
- blujay/types/group_participant.py +39 -0
- blujay/types/group_participant_list.py +21 -0
- blujay/types/group_participant_status.py +5 -0
- blujay/types/group_participant_type.py +5 -0
- blujay/types/group_participant_webhook_data.py +27 -0
- blujay/types/group_participant_webhook_event.py +47 -0
- blujay/types/group_participant_webhook_event_api_version.py +5 -0
- blujay/types/group_phone_number.py +46 -0
- blujay/types/group_sendability_reason.py +7 -0
- blujay/types/group_webhook_participant.py +30 -0
- blujay/types/group_webhook_participant_status.py +5 -0
- blujay/types/group_webhook_participant_type.py +5 -0
- blujay/types/link_part.py +26 -0
- blujay/types/link_part_type.py +5 -0
- blujay/types/me.py +29 -0
- blujay/types/media_output_part.py +30 -0
- blujay/types/media_output_part_type.py +5 -0
- blujay/types/media_part.py +31 -0
- blujay/types/media_part_type.py +5 -0
- blujay/types/member_id.py +3 -0
- blujay/types/message.py +159 -0
- blujay/types/message_actionable_failure_code.py +14 -0
- blujay/types/message_degradation.py +25 -0
- blujay/types/message_degradation_code.py +7 -0
- blujay/types/message_direction.py +5 -0
- blujay/types/message_edit_history_entry.py +22 -0
- blujay/types/message_edited_webhook_data.py +64 -0
- blujay/types/message_edited_webhook_event.py +47 -0
- blujay/types/message_edited_webhook_event_api_version.py +5 -0
- blujay/types/message_effect.py +8 -0
- blujay/types/message_failure.py +26 -0
- blujay/types/message_failure_code.py +18 -0
- blujay/types/message_id.py +3 -0
- blujay/types/message_input.py +44 -0
- blujay/types/message_input_preferred_service.py +5 -0
- blujay/types/message_lifecycle_webhook_data.py +88 -0
- blujay/types/message_lifecycle_webhook_data_direction.py +5 -0
- blujay/types/message_lifecycle_webhook_data_requested_service.py +5 -0
- blujay/types/message_lifecycle_webhook_data_service.py +5 -0
- blujay/types/message_lifecycle_webhook_data_status.py +7 -0
- blujay/types/message_lifecycle_webhook_event.py +47 -0
- blujay/types/message_lifecycle_webhook_event_api_version.py +5 -0
- blujay/types/message_list.py +24 -0
- blujay/types/message_output_part.py +10 -0
- blujay/types/message_part.py +11 -0
- blujay/types/message_preferred_service.py +5 -0
- blujay/types/message_reaction.py +46 -0
- blujay/types/message_received_webhook_data.py +95 -0
- blujay/types/message_received_webhook_data_direction.py +5 -0
- blujay/types/message_received_webhook_data_requested_service.py +5 -0
- blujay/types/message_received_webhook_data_service.py +5 -0
- blujay/types/message_received_webhook_data_status.py +5 -0
- blujay/types/message_received_webhook_event.py +47 -0
- blujay/types/message_received_webhook_event_api_version.py +5 -0
- blujay/types/message_reply_to.py +39 -0
- blujay/types/message_reply_to_info.py +34 -0
- blujay/types/message_sender.py +36 -0
- blujay/types/message_sender_type.py +5 -0
- blujay/types/message_service.py +5 -0
- blujay/types/message_status.py +7 -0
- blujay/types/message_team_member_id.py +10 -0
- blujay/types/message_unsent_scope.py +5 -0
- blujay/types/message_unsent_webhook_data.py +64 -0
- blujay/types/message_unsent_webhook_data_unsent_scope.py +5 -0
- blujay/types/message_unsent_webhook_event.py +47 -0
- blujay/types/message_unsent_webhook_event_api_version.py +5 -0
- blujay/types/message_webhook_recipient.py +32 -0
- blujay/types/message_webhook_recipient_type.py +5 -0
- blujay/types/new_message.py +68 -0
- blujay/types/new_message_delivery_status.py +5 -0
- blujay/types/new_message_direction.py +5 -0
- blujay/types/new_message_preferred_service.py +5 -0
- blujay/types/new_message_service.py +5 -0
- blujay/types/phone_number.py +79 -0
- blujay/types/phone_number_access_type.py +5 -0
- blujay/types/phone_number_assigned_webhook_data.py +29 -0
- blujay/types/phone_number_assigned_webhook_event.py +47 -0
- blujay/types/phone_number_assigned_webhook_event_api_version.py +5 -0
- blujay/types/phone_number_capabilities.py +26 -0
- blujay/types/phone_number_capabilities_messaging.py +23 -0
- blujay/types/phone_number_capabilities_voice.py +25 -0
- blujay/types/phone_number_health.py +29 -0
- blujay/types/phone_number_health_status.py +5 -0
- blujay/types/phone_number_id.py +3 -0
- blujay/types/phone_number_limits.py +34 -0
- blujay/types/phone_number_limits_daily.py +27 -0
- blujay/types/phone_number_limits_new_contacts.py +28 -0
- blujay/types/phone_number_line_type.py +5 -0
- blujay/types/phone_number_list.py +21 -0
- blujay/types/phone_number_outbound_policy.py +31 -0
- blujay/types/phone_number_queue.py +26 -0
- blujay/types/phone_number_released_webhook_data.py +29 -0
- blujay/types/phone_number_released_webhook_event.py +47 -0
- blujay/types/phone_number_released_webhook_event_api_version.py +5 -0
- blujay/types/phone_number_send_status.py +33 -0
- blujay/types/phone_number_send_status_reason_code.py +7 -0
- blujay/types/phone_number_status.py +5 -0
- blujay/types/reaction_emoji.py +6 -0
- blujay/types/reaction_kind.py +7 -0
- blujay/types/reaction_reactor.py +8 -0
- blujay/types/reaction_reactor_address.py +22 -0
- blujay/types/reaction_reactor_address_type.py +5 -0
- blujay/types/reaction_reactor_phone_number_id.py +23 -0
- blujay/types/reaction_reactor_phone_number_id_type.py +5 -0
- blujay/types/reaction_sticker.py +32 -0
- blujay/types/reaction_type.py +7 -0
- blujay/types/reaction_webhook_data.py +36 -0
- blujay/types/reaction_webhook_data_reaction.py +37 -0
- blujay/types/reaction_webhook_event.py +47 -0
- blujay/types/reaction_webhook_event_api_version.py +5 -0
- blujay/types/screen_effect.py +23 -0
- blujay/types/screen_effect_name.py +20 -0
- blujay/types/screen_effect_type.py +5 -0
- blujay/types/success_envelope.py +34 -0
- blujay/types/team_member.py +23 -0
- blujay/types/text_decoration.py +30 -0
- blujay/types/text_decoration_style.py +5 -0
- blujay/types/text_part.py +27 -0
- blujay/types/text_part_type.py +5 -0
- blujay/types/trace_id.py +3 -0
- blujay/types/typing_webhook_data.py +39 -0
- blujay/types/typing_webhook_event.py +47 -0
- blujay/types/typing_webhook_event_api_version.py +5 -0
- blujay/types/typing_webhook_participant.py +28 -0
- blujay/types/typing_webhook_participant_type.py +5 -0
- blujay/types/vcard.py +38 -0
- blujay/types/vcard_email.py +22 -0
- blujay/types/vcard_email_input.py +22 -0
- blujay/types/vcard_email_input_type.py +5 -0
- blujay/types/vcard_email_type.py +5 -0
- blujay/types/vcard_fields.py +39 -0
- blujay/types/vcard_id.py +3 -0
- blujay/types/vcard_list.py +24 -0
- blujay/types/vcard_part.py +27 -0
- blujay/types/vcard_part_type.py +5 -0
- blujay/types/vcard_phone.py +26 -0
- blujay/types/vcard_phone_input.py +26 -0
- blujay/types/vcard_phone_input_type.py +5 -0
- blujay/types/vcard_phone_type.py +5 -0
- blujay/types/webhook_delivery_attempt.py +54 -0
- blujay/types/webhook_delivery_attempt_delivery_mode.py +5 -0
- blujay/types/webhook_delivery_attempt_error_code.py +26 -0
- blujay/types/webhook_delivery_attempt_list.py +24 -0
- blujay/types/webhook_delivery_attempt_status.py +5 -0
- blujay/types/webhook_envelope.py +51 -0
- blujay/types/webhook_envelope_api_version.py +5 -0
- blujay/types/webhook_event.py +620 -0
- blujay/types/webhook_event_type.py +31 -0
- blujay/types/webhook_payload_version.py +7 -0
- blujay/types/webhook_phone_number_filter.py +50 -0
- blujay/types/webhook_phone_number_filter_all.py +18 -0
- blujay/types/webhook_phone_number_filter_selected.py +20 -0
- blujay/types/webhook_replay_accepted.py +25 -0
- blujay/types/webhook_replay_accepted_status.py +5 -0
- blujay/types/webhook_subscribable_event_type.py +31 -0
- blujay/types/webhook_subscription.py +38 -0
- blujay/types/webhook_subscription_id.py +3 -0
- blujay/types/webhook_subscription_list.py +24 -0
- blujay/types/webhook_subscription_status.py +5 -0
- blujay/types/webhook_subscription_with_secret.py +43 -0
- blujay/types/workflow.py +22 -0
- blujay/types/workflow_id.py +3 -0
- blujay/types/workflow_list.py +21 -0
- blujay/types/workflow_metadata.py +10 -0
- blujay/types/workflow_metadata_value.py +5 -0
- blujay/types/workflow_run_summary.py +24 -0
- blujay/types/workflow_trigger.py +32 -0
- blujay/types/workspace_id.py +3 -0
- blujay/vcards/__init__.py +44 -0
- blujay/vcards/client.py +578 -0
- blujay/vcards/raw_client.py +1191 -0
- blujay/vcards/types/__init__.py +42 -0
- blujay/vcards/types/vcard_create_response.py +30 -0
- blujay/vcards/types/vcard_get_response.py +30 -0
- blujay/vcards/types/vcard_list_response.py +30 -0
- blujay/vcards/types/vcard_update_response.py +30 -0
- blujay/webhook_subscriptions/__init__.py +55 -0
- blujay/webhook_subscriptions/client.py +804 -0
- blujay/webhook_subscriptions/raw_client.py +1723 -0
- blujay/webhook_subscriptions/types/__init__.py +53 -0
- blujay/webhook_subscriptions/types/webhook_subscription_create_response.py +30 -0
- blujay/webhook_subscriptions/types/webhook_subscription_get_response.py +30 -0
- blujay/webhook_subscriptions/types/webhook_subscription_list_deliveries_response.py +30 -0
- blujay/webhook_subscriptions/types/webhook_subscription_list_response.py +30 -0
- blujay/webhook_subscriptions/types/webhook_subscription_replay_event_response.py +30 -0
- blujay/webhook_subscriptions/types/webhook_subscription_update_response.py +30 -0
- blujay/webhooks.py +124 -0
- blujay/workflows/__init__.py +40 -0
- blujay/workflows/client.py +235 -0
- blujay/workflows/raw_client.py +510 -0
- blujay/workflows/types/__init__.py +38 -0
- blujay/workflows/types/workflow_enroll_response.py +30 -0
- blujay/workflows/types/workflow_list_response.py +30 -0
- blujay-1.0.0.dist-info/METADATA +274 -0
- blujay-1.0.0.dist-info/RECORD +455 -0
- blujay-1.0.0.dist-info/WHEEL +4 -0
- blujay-1.0.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .attachment_create_response import AttachmentCreateResponse
|
|
10
|
+
from .attachment_get_response import AttachmentGetResponse
|
|
11
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
12
|
+
"AttachmentCreateResponse": ".attachment_create_response",
|
|
13
|
+
"AttachmentGetResponse": ".attachment_get_response",
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
18
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
19
|
+
if module_name is None:
|
|
20
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
21
|
+
try:
|
|
22
|
+
module = import_module(module_name, __package__)
|
|
23
|
+
if module_name == f".{attr_name}":
|
|
24
|
+
return module
|
|
25
|
+
else:
|
|
26
|
+
return getattr(module, attr_name)
|
|
27
|
+
except ImportError as e:
|
|
28
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
29
|
+
except AttributeError as e:
|
|
30
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def __dir__():
|
|
34
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
35
|
+
return sorted(lazy_attrs)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
__all__ = ["AttachmentCreateResponse", "AttachmentGetResponse"]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
|
+
from ...core.unchecked_base_model import UncheckedBaseModel
|
|
9
|
+
from ...types.attachment_upload import AttachmentUpload
|
|
10
|
+
from ...types.trace_id import TraceId
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class AttachmentCreateResponse(UncheckedBaseModel):
|
|
14
|
+
data: AttachmentUpload
|
|
15
|
+
status: str
|
|
16
|
+
trace_id: TraceId
|
|
17
|
+
timestamp: dt.datetime
|
|
18
|
+
client_request_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
19
|
+
"""
|
|
20
|
+
Your `X-Request-ID` header value, echoed back when you send one. Not included on the send responses (`POST /v1/chats` and `POST /v1/chats/{chat_id}/messages`); keep your own mapping from your request ID to the returned message ID there.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
if IS_PYDANTIC_V2:
|
|
24
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
25
|
+
else:
|
|
26
|
+
|
|
27
|
+
class Config:
|
|
28
|
+
frozen = True
|
|
29
|
+
smart_union = True
|
|
30
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
|
+
from ...core.unchecked_base_model import UncheckedBaseModel
|
|
9
|
+
from ...types.attachment import Attachment
|
|
10
|
+
from ...types.trace_id import TraceId
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class AttachmentGetResponse(UncheckedBaseModel):
|
|
14
|
+
data: Attachment
|
|
15
|
+
status: str
|
|
16
|
+
trace_id: TraceId
|
|
17
|
+
timestamp: dt.datetime
|
|
18
|
+
client_request_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
19
|
+
"""
|
|
20
|
+
Your `X-Request-ID` header value, echoed back when you send one. Not included on the send responses (`POST /v1/chats` and `POST /v1/chats/{chat_id}/messages`); keep your own mapping from your request ID to the returned message ID there.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
if IS_PYDANTIC_V2:
|
|
24
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
25
|
+
else:
|
|
26
|
+
|
|
27
|
+
class Config:
|
|
28
|
+
frozen = True
|
|
29
|
+
smart_union = True
|
|
30
|
+
extra = pydantic.Extra.allow
|
blujay/calls/__init__.py
ADDED
blujay/calls/client.py
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
+
from ..core.request_options import RequestOptions
|
|
7
|
+
from ..types.call_id import CallId
|
|
8
|
+
from .raw_client import AsyncRawCallsClient, RawCallsClient
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class CallsClient:
|
|
12
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
13
|
+
self._raw_client = RawCallsClient(client_wrapper=client_wrapper)
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def with_raw_response(self) -> RawCallsClient:
|
|
17
|
+
"""
|
|
18
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
19
|
+
|
|
20
|
+
Returns
|
|
21
|
+
-------
|
|
22
|
+
RawCallsClient
|
|
23
|
+
"""
|
|
24
|
+
return self._raw_client
|
|
25
|
+
|
|
26
|
+
def download_recording(
|
|
27
|
+
self, call_id: CallId, *, request_options: typing.Optional[RequestOptions] = None
|
|
28
|
+
) -> typing.Iterator[bytes]:
|
|
29
|
+
"""
|
|
30
|
+
Returns the call's recording as audio. `call.recording_ready` webhooks link here through `recording.download_url`. Authenticate the same way as any other API call.
|
|
31
|
+
|
|
32
|
+
Parameters
|
|
33
|
+
----------
|
|
34
|
+
call_id : CallId
|
|
35
|
+
|
|
36
|
+
request_options : typing.Optional[RequestOptions]
|
|
37
|
+
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
|
|
38
|
+
|
|
39
|
+
Returns
|
|
40
|
+
-------
|
|
41
|
+
typing.Iterator[bytes]
|
|
42
|
+
The recording.
|
|
43
|
+
|
|
44
|
+
Examples
|
|
45
|
+
--------
|
|
46
|
+
from blujay import Blujay
|
|
47
|
+
|
|
48
|
+
client = Blujay(
|
|
49
|
+
api_key="YOUR_API_KEY",
|
|
50
|
+
)
|
|
51
|
+
client.calls.download_recording(
|
|
52
|
+
call_id="call_abc123",
|
|
53
|
+
)
|
|
54
|
+
"""
|
|
55
|
+
with self._raw_client.download_recording(call_id, request_options=request_options) as r:
|
|
56
|
+
yield from r.data
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class AsyncCallsClient:
|
|
60
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
61
|
+
self._raw_client = AsyncRawCallsClient(client_wrapper=client_wrapper)
|
|
62
|
+
|
|
63
|
+
@property
|
|
64
|
+
def with_raw_response(self) -> AsyncRawCallsClient:
|
|
65
|
+
"""
|
|
66
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
67
|
+
|
|
68
|
+
Returns
|
|
69
|
+
-------
|
|
70
|
+
AsyncRawCallsClient
|
|
71
|
+
"""
|
|
72
|
+
return self._raw_client
|
|
73
|
+
|
|
74
|
+
async def download_recording(
|
|
75
|
+
self, call_id: CallId, *, request_options: typing.Optional[RequestOptions] = None
|
|
76
|
+
) -> typing.AsyncIterator[bytes]:
|
|
77
|
+
"""
|
|
78
|
+
Returns the call's recording as audio. `call.recording_ready` webhooks link here through `recording.download_url`. Authenticate the same way as any other API call.
|
|
79
|
+
|
|
80
|
+
Parameters
|
|
81
|
+
----------
|
|
82
|
+
call_id : CallId
|
|
83
|
+
|
|
84
|
+
request_options : typing.Optional[RequestOptions]
|
|
85
|
+
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
|
|
86
|
+
|
|
87
|
+
Returns
|
|
88
|
+
-------
|
|
89
|
+
typing.AsyncIterator[bytes]
|
|
90
|
+
The recording.
|
|
91
|
+
|
|
92
|
+
Examples
|
|
93
|
+
--------
|
|
94
|
+
import asyncio
|
|
95
|
+
|
|
96
|
+
from blujay import AsyncBlujay
|
|
97
|
+
|
|
98
|
+
client = AsyncBlujay(
|
|
99
|
+
api_key="YOUR_API_KEY",
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
async def main() -> None:
|
|
104
|
+
await client.calls.download_recording(
|
|
105
|
+
call_id="call_abc123",
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
asyncio.run(main())
|
|
110
|
+
"""
|
|
111
|
+
async with self._raw_client.download_recording(call_id, request_options=request_options) as r:
|
|
112
|
+
async for _chunk in r.data:
|
|
113
|
+
yield _chunk
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import contextlib
|
|
4
|
+
import typing
|
|
5
|
+
from json.decoder import JSONDecodeError
|
|
6
|
+
|
|
7
|
+
from ..core.api_error import ApiError
|
|
8
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
9
|
+
from ..core.http_response import AsyncHttpResponse, HttpResponse
|
|
10
|
+
from ..core.jsonable_encoder import encode_path_param
|
|
11
|
+
from ..core.parse_error import ParsingError
|
|
12
|
+
from ..core.request_options import RequestOptions
|
|
13
|
+
from ..core.unchecked_base_model import construct_type
|
|
14
|
+
from ..errors.bad_request_error import BadRequestError
|
|
15
|
+
from ..errors.internal_server_error import InternalServerError
|
|
16
|
+
from ..errors.not_found_error import NotFoundError
|
|
17
|
+
from ..errors.service_unavailable_error import ServiceUnavailableError
|
|
18
|
+
from ..errors.too_many_requests_error import TooManyRequestsError
|
|
19
|
+
from ..errors.unauthorized_error import UnauthorizedError
|
|
20
|
+
from ..types.call_id import CallId
|
|
21
|
+
from ..types.error_envelope import ErrorEnvelope
|
|
22
|
+
from pydantic import ValidationError
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class RawCallsClient:
|
|
26
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
27
|
+
self._client_wrapper = client_wrapper
|
|
28
|
+
|
|
29
|
+
@contextlib.contextmanager
|
|
30
|
+
def download_recording(
|
|
31
|
+
self, call_id: CallId, *, request_options: typing.Optional[RequestOptions] = None
|
|
32
|
+
) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]:
|
|
33
|
+
"""
|
|
34
|
+
Returns the call's recording as audio. `call.recording_ready` webhooks link here through `recording.download_url`. Authenticate the same way as any other API call.
|
|
35
|
+
|
|
36
|
+
Parameters
|
|
37
|
+
----------
|
|
38
|
+
call_id : CallId
|
|
39
|
+
|
|
40
|
+
request_options : typing.Optional[RequestOptions]
|
|
41
|
+
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
|
|
42
|
+
|
|
43
|
+
Returns
|
|
44
|
+
-------
|
|
45
|
+
typing.Iterator[HttpResponse[typing.Iterator[bytes]]]
|
|
46
|
+
The recording.
|
|
47
|
+
"""
|
|
48
|
+
with self._client_wrapper.httpx_client.stream(
|
|
49
|
+
f"v1/calls/{encode_path_param(call_id)}/recording",
|
|
50
|
+
method="GET",
|
|
51
|
+
request_options=request_options,
|
|
52
|
+
) as _response:
|
|
53
|
+
|
|
54
|
+
def _stream() -> HttpResponse[typing.Iterator[bytes]]:
|
|
55
|
+
try:
|
|
56
|
+
if 200 <= _response.status_code < 300:
|
|
57
|
+
_chunk_size = request_options.get("chunk_size", None) if request_options is not None else None
|
|
58
|
+
return HttpResponse(
|
|
59
|
+
response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size))
|
|
60
|
+
)
|
|
61
|
+
_response.read()
|
|
62
|
+
if _response.status_code == 400:
|
|
63
|
+
raise BadRequestError(
|
|
64
|
+
headers=dict(_response.headers),
|
|
65
|
+
body=typing.cast(
|
|
66
|
+
ErrorEnvelope,
|
|
67
|
+
construct_type(
|
|
68
|
+
type_=ErrorEnvelope, # type: ignore
|
|
69
|
+
object_=_response.json(),
|
|
70
|
+
),
|
|
71
|
+
),
|
|
72
|
+
)
|
|
73
|
+
if _response.status_code == 401:
|
|
74
|
+
raise UnauthorizedError(
|
|
75
|
+
headers=dict(_response.headers),
|
|
76
|
+
body=typing.cast(
|
|
77
|
+
ErrorEnvelope,
|
|
78
|
+
construct_type(
|
|
79
|
+
type_=ErrorEnvelope, # type: ignore
|
|
80
|
+
object_=_response.json(),
|
|
81
|
+
),
|
|
82
|
+
),
|
|
83
|
+
)
|
|
84
|
+
if _response.status_code == 404:
|
|
85
|
+
raise NotFoundError(
|
|
86
|
+
headers=dict(_response.headers),
|
|
87
|
+
body=typing.cast(
|
|
88
|
+
ErrorEnvelope,
|
|
89
|
+
construct_type(
|
|
90
|
+
type_=ErrorEnvelope, # type: ignore
|
|
91
|
+
object_=_response.json(),
|
|
92
|
+
),
|
|
93
|
+
),
|
|
94
|
+
)
|
|
95
|
+
if _response.status_code == 429:
|
|
96
|
+
raise TooManyRequestsError(
|
|
97
|
+
headers=dict(_response.headers),
|
|
98
|
+
body=typing.cast(
|
|
99
|
+
ErrorEnvelope,
|
|
100
|
+
construct_type(
|
|
101
|
+
type_=ErrorEnvelope, # type: ignore
|
|
102
|
+
object_=_response.json(),
|
|
103
|
+
),
|
|
104
|
+
),
|
|
105
|
+
)
|
|
106
|
+
if _response.status_code == 500:
|
|
107
|
+
raise InternalServerError(
|
|
108
|
+
headers=dict(_response.headers),
|
|
109
|
+
body=typing.cast(
|
|
110
|
+
ErrorEnvelope,
|
|
111
|
+
construct_type(
|
|
112
|
+
type_=ErrorEnvelope, # type: ignore
|
|
113
|
+
object_=_response.json(),
|
|
114
|
+
),
|
|
115
|
+
),
|
|
116
|
+
)
|
|
117
|
+
if _response.status_code == 503:
|
|
118
|
+
raise ServiceUnavailableError(
|
|
119
|
+
headers=dict(_response.headers),
|
|
120
|
+
body=typing.cast(
|
|
121
|
+
ErrorEnvelope,
|
|
122
|
+
construct_type(
|
|
123
|
+
type_=ErrorEnvelope, # type: ignore
|
|
124
|
+
object_=_response.json(),
|
|
125
|
+
),
|
|
126
|
+
),
|
|
127
|
+
)
|
|
128
|
+
_response_json = _response.json()
|
|
129
|
+
except JSONDecodeError:
|
|
130
|
+
raise ApiError(
|
|
131
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
|
|
132
|
+
)
|
|
133
|
+
except ValidationError as e:
|
|
134
|
+
raise ParsingError(
|
|
135
|
+
status_code=_response.status_code,
|
|
136
|
+
headers=dict(_response.headers),
|
|
137
|
+
body=_response.json(),
|
|
138
|
+
cause=e,
|
|
139
|
+
)
|
|
140
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
141
|
+
|
|
142
|
+
yield _stream()
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
class AsyncRawCallsClient:
|
|
146
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
147
|
+
self._client_wrapper = client_wrapper
|
|
148
|
+
|
|
149
|
+
@contextlib.asynccontextmanager
|
|
150
|
+
async def download_recording(
|
|
151
|
+
self, call_id: CallId, *, request_options: typing.Optional[RequestOptions] = None
|
|
152
|
+
) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]:
|
|
153
|
+
"""
|
|
154
|
+
Returns the call's recording as audio. `call.recording_ready` webhooks link here through `recording.download_url`. Authenticate the same way as any other API call.
|
|
155
|
+
|
|
156
|
+
Parameters
|
|
157
|
+
----------
|
|
158
|
+
call_id : CallId
|
|
159
|
+
|
|
160
|
+
request_options : typing.Optional[RequestOptions]
|
|
161
|
+
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
|
|
162
|
+
|
|
163
|
+
Returns
|
|
164
|
+
-------
|
|
165
|
+
typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]
|
|
166
|
+
The recording.
|
|
167
|
+
"""
|
|
168
|
+
async with self._client_wrapper.httpx_client.stream(
|
|
169
|
+
f"v1/calls/{encode_path_param(call_id)}/recording",
|
|
170
|
+
method="GET",
|
|
171
|
+
request_options=request_options,
|
|
172
|
+
) as _response:
|
|
173
|
+
|
|
174
|
+
async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]:
|
|
175
|
+
try:
|
|
176
|
+
if 200 <= _response.status_code < 300:
|
|
177
|
+
_chunk_size = request_options.get("chunk_size", None) if request_options is not None else None
|
|
178
|
+
return AsyncHttpResponse(
|
|
179
|
+
response=_response,
|
|
180
|
+
data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)),
|
|
181
|
+
)
|
|
182
|
+
await _response.aread()
|
|
183
|
+
if _response.status_code == 400:
|
|
184
|
+
raise BadRequestError(
|
|
185
|
+
headers=dict(_response.headers),
|
|
186
|
+
body=typing.cast(
|
|
187
|
+
ErrorEnvelope,
|
|
188
|
+
construct_type(
|
|
189
|
+
type_=ErrorEnvelope, # type: ignore
|
|
190
|
+
object_=_response.json(),
|
|
191
|
+
),
|
|
192
|
+
),
|
|
193
|
+
)
|
|
194
|
+
if _response.status_code == 401:
|
|
195
|
+
raise UnauthorizedError(
|
|
196
|
+
headers=dict(_response.headers),
|
|
197
|
+
body=typing.cast(
|
|
198
|
+
ErrorEnvelope,
|
|
199
|
+
construct_type(
|
|
200
|
+
type_=ErrorEnvelope, # type: ignore
|
|
201
|
+
object_=_response.json(),
|
|
202
|
+
),
|
|
203
|
+
),
|
|
204
|
+
)
|
|
205
|
+
if _response.status_code == 404:
|
|
206
|
+
raise NotFoundError(
|
|
207
|
+
headers=dict(_response.headers),
|
|
208
|
+
body=typing.cast(
|
|
209
|
+
ErrorEnvelope,
|
|
210
|
+
construct_type(
|
|
211
|
+
type_=ErrorEnvelope, # type: ignore
|
|
212
|
+
object_=_response.json(),
|
|
213
|
+
),
|
|
214
|
+
),
|
|
215
|
+
)
|
|
216
|
+
if _response.status_code == 429:
|
|
217
|
+
raise TooManyRequestsError(
|
|
218
|
+
headers=dict(_response.headers),
|
|
219
|
+
body=typing.cast(
|
|
220
|
+
ErrorEnvelope,
|
|
221
|
+
construct_type(
|
|
222
|
+
type_=ErrorEnvelope, # type: ignore
|
|
223
|
+
object_=_response.json(),
|
|
224
|
+
),
|
|
225
|
+
),
|
|
226
|
+
)
|
|
227
|
+
if _response.status_code == 500:
|
|
228
|
+
raise InternalServerError(
|
|
229
|
+
headers=dict(_response.headers),
|
|
230
|
+
body=typing.cast(
|
|
231
|
+
ErrorEnvelope,
|
|
232
|
+
construct_type(
|
|
233
|
+
type_=ErrorEnvelope, # type: ignore
|
|
234
|
+
object_=_response.json(),
|
|
235
|
+
),
|
|
236
|
+
),
|
|
237
|
+
)
|
|
238
|
+
if _response.status_code == 503:
|
|
239
|
+
raise ServiceUnavailableError(
|
|
240
|
+
headers=dict(_response.headers),
|
|
241
|
+
body=typing.cast(
|
|
242
|
+
ErrorEnvelope,
|
|
243
|
+
construct_type(
|
|
244
|
+
type_=ErrorEnvelope, # type: ignore
|
|
245
|
+
object_=_response.json(),
|
|
246
|
+
),
|
|
247
|
+
),
|
|
248
|
+
)
|
|
249
|
+
_response_json = _response.json()
|
|
250
|
+
except JSONDecodeError:
|
|
251
|
+
raise ApiError(
|
|
252
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
|
|
253
|
+
)
|
|
254
|
+
except ValidationError as e:
|
|
255
|
+
raise ParsingError(
|
|
256
|
+
status_code=_response.status_code,
|
|
257
|
+
headers=dict(_response.headers),
|
|
258
|
+
body=_response.json(),
|
|
259
|
+
cause=e,
|
|
260
|
+
)
|
|
261
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
262
|
+
|
|
263
|
+
yield await _stream()
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .types import CapabilityEvaluateServiceResponse
|
|
10
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
11
|
+
"CapabilityEvaluateServiceResponse": ".types",
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
16
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
17
|
+
if module_name is None:
|
|
18
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
19
|
+
try:
|
|
20
|
+
module = import_module(module_name, __package__)
|
|
21
|
+
if module_name == f".{attr_name}":
|
|
22
|
+
return module
|
|
23
|
+
else:
|
|
24
|
+
return getattr(module, attr_name)
|
|
25
|
+
except ImportError as e:
|
|
26
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
27
|
+
except AttributeError as e:
|
|
28
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def __dir__():
|
|
32
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
33
|
+
return sorted(lazy_attrs)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
__all__ = ["CapabilityEvaluateServiceResponse"]
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
+
from ..core.request_options import RequestOptions
|
|
7
|
+
from ..types.phone_number_id import PhoneNumberId
|
|
8
|
+
from .raw_client import AsyncRawCapabilityClient, RawCapabilityClient
|
|
9
|
+
from .types.capability_evaluate_service_response import CapabilityEvaluateServiceResponse
|
|
10
|
+
|
|
11
|
+
# this is used as the default value for optional parameters
|
|
12
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class CapabilityClient:
|
|
16
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
17
|
+
self._raw_client = RawCapabilityClient(client_wrapper=client_wrapper)
|
|
18
|
+
|
|
19
|
+
@property
|
|
20
|
+
def with_raw_response(self) -> RawCapabilityClient:
|
|
21
|
+
"""
|
|
22
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
23
|
+
|
|
24
|
+
Returns
|
|
25
|
+
-------
|
|
26
|
+
RawCapabilityClient
|
|
27
|
+
"""
|
|
28
|
+
return self._raw_client
|
|
29
|
+
|
|
30
|
+
def evaluate_service(
|
|
31
|
+
self,
|
|
32
|
+
*,
|
|
33
|
+
number: str,
|
|
34
|
+
from_phone_number_id: typing.Optional[PhoneNumberId] = OMIT,
|
|
35
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
36
|
+
) -> CapabilityEvaluateServiceResponse:
|
|
37
|
+
"""
|
|
38
|
+
Checks which service Blujay would use to reach a US phone number from one of your numbers: `iMessage`, `RCS` or `SMS`. If Blujay can't confirm iMessage or RCS, the result is `SMS`.
|
|
39
|
+
|
|
40
|
+
You can also check an email address. An email address is only ever texted over iMessage, so the result is `iMessage` when Blujay confirms it, and `null` otherwise.
|
|
41
|
+
|
|
42
|
+
If Blujay already checked the same recipient from the same number in the last five minutes (through this endpoint, the Blujay app, or a send), you get that answer with `source: cached`. Cached answers are free and never limited.
|
|
43
|
+
|
|
44
|
+
A fresh check runs from your number and shares its capacity with your messages, which always go first. Each of your numbers can run 30 fresh checks per clock hour and 100 per UTC day. Over a limit, or while the number is busy, the call returns `429 RATE_LIMIT_EXCEEDED` with `Retry-After`.
|
|
45
|
+
|
|
46
|
+
This endpoint counts toward your read request limit, not your write limit.
|
|
47
|
+
|
|
48
|
+
Parameters
|
|
49
|
+
----------
|
|
50
|
+
number : str
|
|
51
|
+
The US phone number or email address to check.
|
|
52
|
+
|
|
53
|
+
from_phone_number_id : typing.Optional[PhoneNumberId]
|
|
54
|
+
|
|
55
|
+
request_options : typing.Optional[RequestOptions]
|
|
56
|
+
Request-specific configuration.
|
|
57
|
+
|
|
58
|
+
Returns
|
|
59
|
+
-------
|
|
60
|
+
CapabilityEvaluateServiceResponse
|
|
61
|
+
The service Blujay would use.
|
|
62
|
+
|
|
63
|
+
Examples
|
|
64
|
+
--------
|
|
65
|
+
from blujay import Blujay
|
|
66
|
+
|
|
67
|
+
client = Blujay(
|
|
68
|
+
api_key="YOUR_API_KEY",
|
|
69
|
+
)
|
|
70
|
+
client.capability.evaluate_service(
|
|
71
|
+
number="+15555550123",
|
|
72
|
+
from_phone_number_id="phone_abc123",
|
|
73
|
+
)
|
|
74
|
+
"""
|
|
75
|
+
_response = self._raw_client.evaluate_service(
|
|
76
|
+
number=number, from_phone_number_id=from_phone_number_id, request_options=request_options
|
|
77
|
+
)
|
|
78
|
+
return _response.data
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class AsyncCapabilityClient:
|
|
82
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
83
|
+
self._raw_client = AsyncRawCapabilityClient(client_wrapper=client_wrapper)
|
|
84
|
+
|
|
85
|
+
@property
|
|
86
|
+
def with_raw_response(self) -> AsyncRawCapabilityClient:
|
|
87
|
+
"""
|
|
88
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
89
|
+
|
|
90
|
+
Returns
|
|
91
|
+
-------
|
|
92
|
+
AsyncRawCapabilityClient
|
|
93
|
+
"""
|
|
94
|
+
return self._raw_client
|
|
95
|
+
|
|
96
|
+
async def evaluate_service(
|
|
97
|
+
self,
|
|
98
|
+
*,
|
|
99
|
+
number: str,
|
|
100
|
+
from_phone_number_id: typing.Optional[PhoneNumberId] = OMIT,
|
|
101
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
102
|
+
) -> CapabilityEvaluateServiceResponse:
|
|
103
|
+
"""
|
|
104
|
+
Checks which service Blujay would use to reach a US phone number from one of your numbers: `iMessage`, `RCS` or `SMS`. If Blujay can't confirm iMessage or RCS, the result is `SMS`.
|
|
105
|
+
|
|
106
|
+
You can also check an email address. An email address is only ever texted over iMessage, so the result is `iMessage` when Blujay confirms it, and `null` otherwise.
|
|
107
|
+
|
|
108
|
+
If Blujay already checked the same recipient from the same number in the last five minutes (through this endpoint, the Blujay app, or a send), you get that answer with `source: cached`. Cached answers are free and never limited.
|
|
109
|
+
|
|
110
|
+
A fresh check runs from your number and shares its capacity with your messages, which always go first. Each of your numbers can run 30 fresh checks per clock hour and 100 per UTC day. Over a limit, or while the number is busy, the call returns `429 RATE_LIMIT_EXCEEDED` with `Retry-After`.
|
|
111
|
+
|
|
112
|
+
This endpoint counts toward your read request limit, not your write limit.
|
|
113
|
+
|
|
114
|
+
Parameters
|
|
115
|
+
----------
|
|
116
|
+
number : str
|
|
117
|
+
The US phone number or email address to check.
|
|
118
|
+
|
|
119
|
+
from_phone_number_id : typing.Optional[PhoneNumberId]
|
|
120
|
+
|
|
121
|
+
request_options : typing.Optional[RequestOptions]
|
|
122
|
+
Request-specific configuration.
|
|
123
|
+
|
|
124
|
+
Returns
|
|
125
|
+
-------
|
|
126
|
+
CapabilityEvaluateServiceResponse
|
|
127
|
+
The service Blujay would use.
|
|
128
|
+
|
|
129
|
+
Examples
|
|
130
|
+
--------
|
|
131
|
+
import asyncio
|
|
132
|
+
|
|
133
|
+
from blujay import AsyncBlujay
|
|
134
|
+
|
|
135
|
+
client = AsyncBlujay(
|
|
136
|
+
api_key="YOUR_API_KEY",
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
async def main() -> None:
|
|
141
|
+
await client.capability.evaluate_service(
|
|
142
|
+
number="+15555550123",
|
|
143
|
+
from_phone_number_id="phone_abc123",
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
asyncio.run(main())
|
|
148
|
+
"""
|
|
149
|
+
_response = await self._raw_client.evaluate_service(
|
|
150
|
+
number=number, from_phone_number_id=from_phone_number_id, request_options=request_options
|
|
151
|
+
)
|
|
152
|
+
return _response.data
|