one_msg_sdk 2.0.1 → 2.0.3
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.
- checksums.yaml +4 -4
- data/AGENTS.md +65 -19
- data/README.md +102 -34
- data/docs/AddTemplate200Response.md +18 -0
- data/docs/AddTemplateRequest.md +7 -7
- data/docs/CallingApi.md +27 -31
- data/docs/CallingSettings.md +18 -0
- data/docs/CallingSettingsCalling.md +38 -0
- data/docs/CallingSettingsCallingAudio.md +18 -0
- data/docs/CallingSettingsCallingCallHours.md +22 -0
- data/docs/CallingSettingsCallingSip.md +20 -0
- data/docs/CallingSettingsCallingSipServersInner.md +28 -0
- data/docs/CallingSettingsCallingVideo.md +18 -0
- data/docs/CatalogApi.md +1 -1
- data/docs/ChannelApi.md +151 -5
- data/docs/CreateFlowsRequest.md +26 -0
- data/docs/CreateGroupsGroupIdRequest.md +22 -0
- data/docs/CreateGroupsRequest.md +20 -0
- data/docs/CreateSettingsRequest.md +28 -0
- data/docs/CreateSettingsRequestWebhookUrl.md +49 -0
- data/docs/CreateUploadMedia200Response.md +18 -0
- data/docs/CreateUploadMediaRequest.md +20 -0
- data/docs/FlowsApi.md +32 -16
- data/docs/GetStatus200Response.md +26 -0
- data/docs/GetWebhook200Response.md +24 -2
- data/docs/GetWebhook200ResponseWebhookUrl.md +49 -0
- data/docs/GroupsApi.md +38 -18
- data/docs/InitiateCallRequest.md +28 -0
- data/docs/InitiateCallRequestSession.md +20 -0
- data/docs/InitiateCallResponse.md +26 -0
- data/docs/InitiateCallResponseCallsInner.md +18 -0
- data/docs/InitiateCallResponseResponse.md +18 -0
- data/docs/ListSettings200Response.md +52 -0
- data/docs/ListSettings200ResponseWebhookUrl.md +49 -0
- data/docs/MessagingApi.md +140 -35
- data/docs/PatchFlowsFlowIdAssetsRequest.md +18 -0
- data/docs/PatchFlowsFlowIdMetadataRequest.md +22 -0
- data/docs/ProfileApi.md +9 -11
- data/docs/RemoveTemplateRequest.md +18 -0
- data/docs/SendButtonRequest.md +9 -1
- data/docs/SendCarouselRequest1.md +4 -2
- data/docs/SendContactInfoRequest.md +26 -0
- data/docs/SendContactRequest.md +7 -1
- data/docs/SendContactRequestContact.md +26 -0
- data/docs/SendContactRequestContactName.md +49 -0
- data/docs/SendContactRequestContactsInner.md +3 -3
- data/docs/SendContactRequestContactsInnerPhonesInner.md +1 -1
- data/docs/SendListRequest.md +5 -1
- data/docs/SendLocationRequestRequest.md +5 -1
- data/docs/SendMessageRequest.md +6 -2
- data/docs/SendMessageRequestDirectSend.md +20 -0
- data/docs/SendProductRequest.md +30 -0
- data/docs/SendReactionRequest.md +3 -1
- data/docs/SendTemplateRequest.md +9 -5
- data/docs/SendTemplateRequestLanguage.md +3 -3
- data/docs/SetWebhook200Response.md +20 -0
- data/docs/SetWebhook200ResponseWebhookUrl.md +49 -0
- data/docs/SetWebhookRequest.md +18 -0
- data/docs/SetWebhookRequestWebhookUrl.md +49 -0
- data/docs/TemplatesApi.md +29 -17
- data/docs/UpdateCallingSettings200Response.md +22 -0
- data/docs/UpdateCallingSettings200ResponseResponse.md +18 -0
- data/docs/UpdateMe200Response.md +18 -0
- data/docs/UpdateMeRequest.md +6 -6
- data/docs/WebhookUrlStatus.md +34 -0
- data/docs/WebhooksApi.md +10 -12
- data/lib/one_msg_sdk/api/calling_api.rb +39 -31
- data/lib/one_msg_sdk/api/catalog_api.rb +4 -4
- data/lib/one_msg_sdk/api/channel_api.rb +146 -7
- data/lib/one_msg_sdk/api/flows_api.rb +58 -14
- data/lib/one_msg_sdk/api/groups_api.rb +48 -10
- data/lib/one_msg_sdk/api/messaging_api.rb +163 -38
- data/lib/one_msg_sdk/api/profile_api.rb +17 -13
- data/lib/one_msg_sdk/api/templates_api.rb +36 -13
- data/lib/one_msg_sdk/api/users_api.rb +2 -2
- data/lib/one_msg_sdk/api/webhooks_api.rb +19 -15
- data/lib/one_msg_sdk/api_client.rb +2 -2
- data/lib/one_msg_sdk/api_error.rb +2 -2
- data/lib/one_msg_sdk/api_model_base.rb +2 -2
- data/lib/one_msg_sdk/configuration.rb +2 -2
- data/lib/one_msg_sdk/models/add_template200_response.rb +150 -0
- data/lib/one_msg_sdk/models/add_template_request.rb +6 -2
- data/lib/one_msg_sdk/models/block_user_request.rb +2 -2
- data/lib/one_msg_sdk/models/calling_settings.rb +148 -0
- data/lib/one_msg_sdk/models/calling_settings_calling.rb +321 -0
- data/lib/one_msg_sdk/models/calling_settings_calling_audio.rb +148 -0
- data/lib/one_msg_sdk/models/calling_settings_calling_call_hours.rb +166 -0
- data/lib/one_msg_sdk/models/calling_settings_calling_sip.rb +193 -0
- data/lib/one_msg_sdk/models/calling_settings_calling_sip_servers_inner.rb +196 -0
- data/lib/one_msg_sdk/models/calling_settings_calling_video.rb +182 -0
- data/lib/one_msg_sdk/models/conversational_automation.rb +2 -2
- data/lib/one_msg_sdk/models/conversational_automation_commands_inner.rb +2 -2
- data/lib/one_msg_sdk/models/create_commerce200_response.rb +2 -2
- data/lib/one_msg_sdk/models/create_commerce_request.rb +2 -2
- data/lib/one_msg_sdk/models/create_commerce_request_params.rb +2 -2
- data/lib/one_msg_sdk/models/create_flows_request.rb +238 -0
- data/lib/one_msg_sdk/models/create_groups200_response.rb +2 -2
- data/lib/one_msg_sdk/models/create_groups_group_id_request.rb +168 -0
- data/lib/one_msg_sdk/models/create_groups_request.rb +175 -0
- data/lib/one_msg_sdk/models/create_read_message200_response.rb +2 -2
- data/lib/one_msg_sdk/models/create_read_message401_response.rb +2 -2
- data/lib/one_msg_sdk/models/create_read_message_request.rb +2 -2
- data/lib/one_msg_sdk/models/create_settings_request.rb +192 -0
- data/lib/one_msg_sdk/models/create_settings_request_webhook_url.rb +105 -0
- data/lib/one_msg_sdk/models/create_upload_media200_response.rb +147 -0
- data/lib/one_msg_sdk/models/create_upload_media_request.rb +158 -0
- data/lib/one_msg_sdk/models/delete_flows_flow_id200_response.rb +2 -2
- data/lib/one_msg_sdk/models/delete_groups_group_id200_response.rb +2 -2
- data/lib/one_msg_sdk/models/delete_media_legacy_request.rb +2 -2
- data/lib/one_msg_sdk/models/error_response.rb +2 -2
- data/lib/one_msg_sdk/models/get_commerce200_response_inner.rb +2 -2
- data/lib/one_msg_sdk/models/get_mm_lite_status200_response.rb +2 -2
- data/lib/one_msg_sdk/models/get_status200_response.rb +185 -0
- data/lib/one_msg_sdk/models/get_webhook200_response.rb +155 -6
- data/lib/one_msg_sdk/models/get_webhook200_response_webhook_url.rb +105 -0
- data/lib/one_msg_sdk/models/get_whatsapp_business_encryption200_response.rb +2 -2
- data/lib/one_msg_sdk/models/initiate_call_request.rb +277 -0
- data/lib/one_msg_sdk/models/initiate_call_request_session.rb +217 -0
- data/lib/one_msg_sdk/models/initiate_call_response.rb +188 -0
- data/lib/one_msg_sdk/models/initiate_call_response_calls_inner.rb +147 -0
- data/lib/one_msg_sdk/models/initiate_call_response_response.rb +148 -0
- data/lib/one_msg_sdk/models/list_blocked_users200_response.rb +2 -2
- data/lib/one_msg_sdk/models/list_flows200_response.rb +2 -2
- data/lib/one_msg_sdk/models/list_messages200_response.rb +2 -2
- data/lib/one_msg_sdk/models/list_settings200_response.rb +352 -0
- data/lib/one_msg_sdk/models/list_settings200_response_webhook_url.rb +105 -0
- data/lib/one_msg_sdk/models/list_templates200_response.rb +2 -2
- data/lib/one_msg_sdk/models/message_sent_response.rb +2 -2
- data/lib/one_msg_sdk/models/patch_flows_flow_id_assets200_response.rb +2 -2
- data/lib/one_msg_sdk/models/patch_flows_flow_id_assets_request.rb +167 -0
- data/lib/one_msg_sdk/models/patch_flows_flow_id_metadata_request.rb +190 -0
- data/lib/one_msg_sdk/models/profile_info.rb +2 -2
- data/lib/one_msg_sdk/models/remove_template_request.rb +165 -0
- data/lib/one_msg_sdk/models/retrieve_media200_response.rb +2 -2
- data/lib/one_msg_sdk/models/send_address_message_request.rb +2 -2
- data/lib/one_msg_sdk/models/send_button_request.rb +48 -3
- data/lib/one_msg_sdk/models/send_button_request_sections_inner.rb +2 -2
- data/lib/one_msg_sdk/models/send_button_request_sections_inner_reply.rb +2 -2
- data/lib/one_msg_sdk/models/send_carousel_request1.rb +38 -13
- data/lib/one_msg_sdk/models/send_contact_info_request.rb +222 -0
- data/lib/one_msg_sdk/models/send_contact_request.rb +32 -3
- data/lib/one_msg_sdk/models/send_contact_request_contact.rb +221 -0
- data/lib/one_msg_sdk/models/send_contact_request_contact_name.rb +105 -0
- data/lib/one_msg_sdk/models/send_contact_request_contacts_inner.rb +5 -5
- data/lib/one_msg_sdk/models/send_contact_request_contacts_inner_name.rb +2 -2
- data/lib/one_msg_sdk/models/send_contact_request_contacts_inner_org.rb +2 -2
- data/lib/one_msg_sdk/models/send_contact_request_contacts_inner_phones_inner.rb +3 -2
- data/lib/one_msg_sdk/models/send_cta_url_request.rb +2 -2
- data/lib/one_msg_sdk/models/send_file_request.rb +2 -2
- data/lib/one_msg_sdk/models/send_flow_request1.rb +2 -2
- data/lib/one_msg_sdk/models/send_flow_request1_header.rb +2 -2
- data/lib/one_msg_sdk/models/send_flow_request_header.rb +2 -2
- data/lib/one_msg_sdk/models/send_list_request.rb +23 -3
- data/lib/one_msg_sdk/models/send_list_request_sections_inner.rb +2 -2
- data/lib/one_msg_sdk/models/send_list_request_sections_inner_rows_inner.rb +2 -2
- data/lib/one_msg_sdk/models/send_location_request1.rb +2 -2
- data/lib/one_msg_sdk/models/send_location_request_request.rb +23 -3
- data/lib/one_msg_sdk/models/send_message_request.rb +60 -28
- data/lib/one_msg_sdk/models/send_message_request_direct_send.rb +189 -0
- data/lib/one_msg_sdk/models/send_order_details_request.rb +2 -2
- data/lib/one_msg_sdk/models/send_order_details_request_language.rb +2 -2
- data/lib/one_msg_sdk/models/send_order_details_request_order.rb +2 -2
- data/lib/one_msg_sdk/models/send_order_details_request_order_items_inner.rb +2 -2
- data/lib/one_msg_sdk/models/send_order_details_request_order_items_inner_amount.rb +2 -2
- data/lib/one_msg_sdk/models/send_payment_request_request.rb +2 -2
- data/lib/one_msg_sdk/models/send_product_request.rb +225 -0
- data/lib/one_msg_sdk/models/send_reaction_request.rb +14 -3
- data/lib/one_msg_sdk/models/send_sticker_request.rb +2 -2
- data/lib/one_msg_sdk/models/send_template_request.rb +29 -5
- data/lib/one_msg_sdk/models/send_template_request_language.rb +6 -2
- data/lib/one_msg_sdk/models/set_webhook200_response.rb +157 -0
- data/lib/one_msg_sdk/models/set_webhook200_response_webhook_url.rb +105 -0
- data/lib/one_msg_sdk/models/set_webhook_request.rb +164 -0
- data/lib/one_msg_sdk/models/set_webhook_request_webhook_url.rb +105 -0
- data/lib/one_msg_sdk/models/set_whatsapp_business_encryption_request.rb +2 -2
- data/lib/one_msg_sdk/models/success_response.rb +2 -2
- data/lib/one_msg_sdk/models/update_calling_settings200_response.rb +165 -0
- data/lib/one_msg_sdk/models/update_calling_settings200_response_response.rb +147 -0
- data/lib/one_msg_sdk/models/update_me200_response.rb +147 -0
- data/lib/one_msg_sdk/models/update_me_request.rb +6 -3
- data/lib/one_msg_sdk/models/webhook_url_status.rb +287 -0
- data/lib/one_msg_sdk/platform_client.rb +182 -0
- data/lib/one_msg_sdk/version.rb +3 -3
- data/lib/one_msg_sdk.rb +44 -2
- data/one_msg_sdk.gemspec +2 -2
- data/spec/api/calling_api_spec.rb +11 -11
- data/spec/api/catalog_api_spec.rb +3 -3
- data/spec/api/channel_api_spec.rb +29 -4
- data/spec/api/flows_api_spec.rb +10 -2
- data/spec/api/groups_api_spec.rb +10 -2
- data/spec/api/messaging_api_spec.rb +37 -9
- data/spec/api/profile_api_spec.rb +5 -5
- data/spec/api/templates_api_spec.rb +11 -5
- data/spec/api/users_api_spec.rb +2 -2
- data/spec/api/webhooks_api_spec.rb +6 -6
- data/spec/models/add_template200_response_spec.rb +36 -0
- data/spec/models/add_template_request_spec.rb +2 -2
- data/spec/models/block_user_request_spec.rb +2 -2
- data/spec/models/calling_settings_calling_audio_spec.rb +36 -0
- data/spec/models/calling_settings_calling_call_hours_spec.rb +48 -0
- data/spec/models/calling_settings_calling_sip_servers_inner_spec.rb +66 -0
- data/spec/models/calling_settings_calling_sip_spec.rb +46 -0
- data/spec/models/calling_settings_calling_spec.rb +112 -0
- data/spec/models/calling_settings_calling_video_spec.rb +40 -0
- data/spec/models/calling_settings_spec.rb +36 -0
- data/spec/models/conversational_automation_commands_inner_spec.rb +2 -2
- data/spec/models/conversational_automation_spec.rb +2 -2
- data/spec/models/create_commerce200_response_spec.rb +2 -2
- data/spec/models/create_commerce_request_params_spec.rb +2 -2
- data/spec/models/create_commerce_request_spec.rb +2 -2
- data/spec/models/create_flows_request_spec.rb +64 -0
- data/spec/models/create_groups200_response_spec.rb +2 -2
- data/spec/models/create_groups_group_id_request_spec.rb +48 -0
- data/spec/models/create_groups_request_spec.rb +42 -0
- data/spec/models/create_read_message200_response_spec.rb +2 -2
- data/spec/models/create_read_message401_response_spec.rb +2 -2
- data/spec/models/create_read_message_request_spec.rb +2 -2
- data/spec/models/create_settings_request_spec.rb +66 -0
- data/spec/models/create_settings_request_webhook_url_spec.rb +32 -0
- data/spec/models/create_upload_media200_response_spec.rb +36 -0
- data/spec/models/create_upload_media_request_spec.rb +42 -0
- data/spec/models/delete_flows_flow_id200_response_spec.rb +2 -2
- data/spec/models/delete_groups_group_id200_response_spec.rb +2 -2
- data/spec/models/delete_media_legacy_request_spec.rb +2 -2
- data/spec/models/error_response_spec.rb +2 -2
- data/spec/models/get_commerce200_response_inner_spec.rb +2 -2
- data/spec/models/get_mm_lite_status200_response_spec.rb +2 -2
- data/spec/models/get_status200_response_spec.rb +60 -0
- data/spec/models/get_webhook200_response_spec.rb +72 -2
- data/spec/models/get_webhook200_response_webhook_url_spec.rb +32 -0
- data/spec/models/get_whatsapp_business_encryption200_response_spec.rb +2 -2
- data/spec/models/initiate_call_request_session_spec.rb +46 -0
- data/spec/models/initiate_call_request_spec.rb +74 -0
- data/spec/models/initiate_call_response_calls_inner_spec.rb +36 -0
- data/spec/models/initiate_call_response_response_spec.rb +36 -0
- data/spec/models/initiate_call_response_spec.rb +60 -0
- data/spec/models/list_blocked_users200_response_spec.rb +2 -2
- data/spec/models/list_flows200_response_spec.rb +2 -2
- data/spec/models/list_messages200_response_spec.rb +2 -2
- data/spec/models/list_settings200_response_spec.rb +142 -0
- data/spec/models/list_settings200_response_webhook_url_spec.rb +32 -0
- data/spec/models/list_templates200_response_spec.rb +2 -2
- data/spec/models/message_sent_response_spec.rb +2 -2
- data/spec/models/patch_flows_flow_id_assets200_response_spec.rb +2 -2
- data/spec/models/patch_flows_flow_id_assets_request_spec.rb +36 -0
- data/spec/models/patch_flows_flow_id_metadata_request_spec.rb +52 -0
- data/spec/models/profile_info_spec.rb +2 -2
- data/spec/models/remove_template_request_spec.rb +36 -0
- data/spec/models/retrieve_media200_response_spec.rb +2 -2
- data/spec/models/send_address_message_request_spec.rb +2 -2
- data/spec/models/send_button_request_sections_inner_reply_spec.rb +2 -2
- data/spec/models/send_button_request_sections_inner_spec.rb +2 -2
- data/spec/models/send_button_request_spec.rb +26 -2
- data/spec/models/send_carousel_request1_spec.rb +8 -2
- data/spec/models/send_contact_info_request_spec.rb +60 -0
- data/spec/models/send_contact_request_contact_name_spec.rb +32 -0
- data/spec/models/send_contact_request_contact_spec.rb +60 -0
- data/spec/models/send_contact_request_contacts_inner_name_spec.rb +2 -2
- data/spec/models/send_contact_request_contacts_inner_org_spec.rb +2 -2
- data/spec/models/send_contact_request_contacts_inner_phones_inner_spec.rb +2 -2
- data/spec/models/send_contact_request_contacts_inner_spec.rb +2 -2
- data/spec/models/send_contact_request_spec.rb +20 -2
- data/spec/models/send_cta_url_request_spec.rb +2 -2
- data/spec/models/send_file_request_spec.rb +2 -2
- data/spec/models/send_flow_request1_header_spec.rb +2 -2
- data/spec/models/send_flow_request1_spec.rb +2 -2
- data/spec/models/send_flow_request_header_spec.rb +2 -2
- data/spec/models/send_list_request_sections_inner_rows_inner_spec.rb +2 -2
- data/spec/models/send_list_request_sections_inner_spec.rb +2 -2
- data/spec/models/send_list_request_spec.rb +14 -2
- data/spec/models/send_location_request1_spec.rb +2 -2
- data/spec/models/send_location_request_request_spec.rb +14 -2
- data/spec/models/send_message_request_direct_send_spec.rb +42 -0
- data/spec/models/send_message_request_spec.rb +18 -2
- data/spec/models/send_order_details_request_language_spec.rb +2 -2
- data/spec/models/send_order_details_request_order_items_inner_amount_spec.rb +2 -2
- data/spec/models/send_order_details_request_order_items_inner_spec.rb +2 -2
- data/spec/models/send_order_details_request_order_spec.rb +2 -2
- data/spec/models/send_order_details_request_spec.rb +2 -2
- data/spec/models/send_payment_request_request_spec.rb +2 -2
- data/spec/models/send_product_request_spec.rb +72 -0
- data/spec/models/send_reaction_request_spec.rb +8 -2
- data/spec/models/send_sticker_request_spec.rb +2 -2
- data/spec/models/send_template_request_language_spec.rb +2 -2
- data/spec/models/send_template_request_spec.rb +14 -2
- data/spec/models/set_webhook200_response_spec.rb +42 -0
- data/spec/models/set_webhook200_response_webhook_url_spec.rb +32 -0
- data/spec/models/set_webhook_request_spec.rb +36 -0
- data/spec/models/set_webhook_request_webhook_url_spec.rb +32 -0
- data/spec/models/set_whatsapp_business_encryption_request_spec.rb +2 -2
- data/spec/models/success_response_spec.rb +2 -2
- data/spec/models/update_calling_settings200_response_response_spec.rb +36 -0
- data/spec/models/update_calling_settings200_response_spec.rb +48 -0
- data/spec/models/update_me200_response_spec.rb +36 -0
- data/spec/models/update_me_request_spec.rb +2 -2
- data/spec/models/webhook_url_status_spec.rb +88 -0
- data/spec/spec_helper.rb +2 -2
- metadata +319 -89
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#1MSG WhatsApp Business API (Public)
|
|
3
|
+
|
|
4
|
+
#Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** Pass the channel token in **one** place. The API checks JSON body (`token`), then query string (`?token=`), then `Authorization: Bearer` header (preferred in production). **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
|
7
|
+
Contact: support@1msg.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module OneMsgSdk
|
|
17
|
+
class ListSettings200Response < ApiModelBase
|
|
18
|
+
attr_accessor :webhook_url
|
|
19
|
+
|
|
20
|
+
# Retry webhooks until acknowledged
|
|
21
|
+
attr_accessor :guaranteed_hooks
|
|
22
|
+
|
|
23
|
+
# Include message ACK / status events in webhooks
|
|
24
|
+
attr_accessor :ack_notifications_on
|
|
25
|
+
|
|
26
|
+
# Forward raw provider webhook payloads
|
|
27
|
+
attr_accessor :raw_hooks
|
|
28
|
+
|
|
29
|
+
attr_accessor :mm_lite_enabled
|
|
30
|
+
|
|
31
|
+
attr_accessor :template_analytics_enabled
|
|
32
|
+
|
|
33
|
+
attr_accessor :cta_url_link_tracking_opted_out
|
|
34
|
+
|
|
35
|
+
# `true` when at least one URL in `webhookUrl` is sticky auto-disabled. Not \"the channel is dead\": other configured URLs still receive events.
|
|
36
|
+
attr_accessor :have_disabled_webhooks
|
|
37
|
+
|
|
38
|
+
# Compatibility scalar for **one** URL (first sticky-disabled, else first configured). Prefer `webhookStatuses[].circuitState`.
|
|
39
|
+
attr_accessor :circuit_state
|
|
40
|
+
|
|
41
|
+
# Last qualifying fail reason of the summary URL
|
|
42
|
+
attr_accessor :reason
|
|
43
|
+
|
|
44
|
+
# Diagnostic only (summary URL). Qualifying failures in the rolling ~10 minute breaker window — not lifetime. Prefer `webhookStatuses`.
|
|
45
|
+
attr_accessor :fails
|
|
46
|
+
|
|
47
|
+
# Diagnostic only (summary URL). Failed recovery probes (≈15 min → 1 h → 6 h). Sticky disable after 3. Not a blind unblock timer.
|
|
48
|
+
attr_accessor :trips
|
|
49
|
+
|
|
50
|
+
# Epoch milliseconds when the summary URL became sticky-disabled
|
|
51
|
+
attr_accessor :disabled_at
|
|
52
|
+
|
|
53
|
+
# Diagnostic only (summary URL). Epoch ms of the first fail in the current ~10 minute window (pairs with `fails`).
|
|
54
|
+
attr_accessor :first_fail_at
|
|
55
|
+
|
|
56
|
+
# Last HTTP status from the summary URL, when known
|
|
57
|
+
attr_accessor :last_status
|
|
58
|
+
|
|
59
|
+
# Epoch milliseconds of the next half-open probe for the summary URL, if any
|
|
60
|
+
attr_accessor :next_probe_at
|
|
61
|
+
|
|
62
|
+
# Currently configured URLs that are sticky auto-disabled (subset of `webhookUrl`)
|
|
63
|
+
attr_accessor :disabled_webhooks
|
|
64
|
+
|
|
65
|
+
# One entry per currently configured URL. Prefer this over top-level `haveDisabledWebhooks` / `circuitState`.
|
|
66
|
+
attr_accessor :webhook_statuses
|
|
67
|
+
|
|
68
|
+
class EnumAttributeValidator
|
|
69
|
+
attr_reader :datatype
|
|
70
|
+
attr_reader :allowable_values
|
|
71
|
+
|
|
72
|
+
def initialize(datatype, allowable_values)
|
|
73
|
+
@allowable_values = allowable_values.map do |value|
|
|
74
|
+
case datatype.to_s
|
|
75
|
+
when /Integer/i
|
|
76
|
+
value.to_i
|
|
77
|
+
when /Float/i
|
|
78
|
+
value.to_f
|
|
79
|
+
else
|
|
80
|
+
value
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def valid?(value)
|
|
86
|
+
!value || allowable_values.include?(value)
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
91
|
+
def self.attribute_map
|
|
92
|
+
{
|
|
93
|
+
:'webhook_url' => :'webhookUrl',
|
|
94
|
+
:'guaranteed_hooks' => :'guaranteedHooks',
|
|
95
|
+
:'ack_notifications_on' => :'ackNotificationsOn',
|
|
96
|
+
:'raw_hooks' => :'rawHooks',
|
|
97
|
+
:'mm_lite_enabled' => :'mm_lite_enabled',
|
|
98
|
+
:'template_analytics_enabled' => :'template_analytics_enabled',
|
|
99
|
+
:'cta_url_link_tracking_opted_out' => :'cta_url_link_tracking_opted_out',
|
|
100
|
+
:'have_disabled_webhooks' => :'haveDisabledWebhooks',
|
|
101
|
+
:'circuit_state' => :'circuitState',
|
|
102
|
+
:'reason' => :'reason',
|
|
103
|
+
:'fails' => :'fails',
|
|
104
|
+
:'trips' => :'trips',
|
|
105
|
+
:'disabled_at' => :'disabledAt',
|
|
106
|
+
:'first_fail_at' => :'firstFailAt',
|
|
107
|
+
:'last_status' => :'lastStatus',
|
|
108
|
+
:'next_probe_at' => :'nextProbeAt',
|
|
109
|
+
:'disabled_webhooks' => :'disabledWebhooks',
|
|
110
|
+
:'webhook_statuses' => :'webhookStatuses'
|
|
111
|
+
}
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Returns attribute mapping this model knows about
|
|
115
|
+
def self.acceptable_attribute_map
|
|
116
|
+
attribute_map
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Returns all the JSON keys this model knows about
|
|
120
|
+
def self.acceptable_attributes
|
|
121
|
+
acceptable_attribute_map.values
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Attribute type mapping.
|
|
125
|
+
def self.openapi_types
|
|
126
|
+
{
|
|
127
|
+
:'webhook_url' => :'ListSettings200ResponseWebhookUrl',
|
|
128
|
+
:'guaranteed_hooks' => :'Boolean',
|
|
129
|
+
:'ack_notifications_on' => :'Boolean',
|
|
130
|
+
:'raw_hooks' => :'Boolean',
|
|
131
|
+
:'mm_lite_enabled' => :'Boolean',
|
|
132
|
+
:'template_analytics_enabled' => :'Boolean',
|
|
133
|
+
:'cta_url_link_tracking_opted_out' => :'Boolean',
|
|
134
|
+
:'have_disabled_webhooks' => :'Boolean',
|
|
135
|
+
:'circuit_state' => :'String',
|
|
136
|
+
:'reason' => :'String',
|
|
137
|
+
:'fails' => :'Integer',
|
|
138
|
+
:'trips' => :'Integer',
|
|
139
|
+
:'disabled_at' => :'Integer',
|
|
140
|
+
:'first_fail_at' => :'Integer',
|
|
141
|
+
:'last_status' => :'Integer',
|
|
142
|
+
:'next_probe_at' => :'Integer',
|
|
143
|
+
:'disabled_webhooks' => :'Array<Hash<String, Object>>',
|
|
144
|
+
:'webhook_statuses' => :'Array<WebhookUrlStatus>'
|
|
145
|
+
}
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# List of attributes with nullable: true
|
|
149
|
+
def self.openapi_nullable
|
|
150
|
+
Set.new([
|
|
151
|
+
])
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Initializes the object
|
|
155
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
156
|
+
def initialize(attributes = {})
|
|
157
|
+
if (!attributes.is_a?(Hash))
|
|
158
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OneMsgSdk::ListSettings200Response` initialize method"
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
162
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
163
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
164
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
165
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OneMsgSdk::ListSettings200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
166
|
+
end
|
|
167
|
+
h[k.to_sym] = v
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if attributes.key?(:'webhook_url')
|
|
171
|
+
self.webhook_url = attributes[:'webhook_url']
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if attributes.key?(:'guaranteed_hooks')
|
|
175
|
+
self.guaranteed_hooks = attributes[:'guaranteed_hooks']
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
if attributes.key?(:'ack_notifications_on')
|
|
179
|
+
self.ack_notifications_on = attributes[:'ack_notifications_on']
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
if attributes.key?(:'raw_hooks')
|
|
183
|
+
self.raw_hooks = attributes[:'raw_hooks']
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
if attributes.key?(:'mm_lite_enabled')
|
|
187
|
+
self.mm_lite_enabled = attributes[:'mm_lite_enabled']
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
if attributes.key?(:'template_analytics_enabled')
|
|
191
|
+
self.template_analytics_enabled = attributes[:'template_analytics_enabled']
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
if attributes.key?(:'cta_url_link_tracking_opted_out')
|
|
195
|
+
self.cta_url_link_tracking_opted_out = attributes[:'cta_url_link_tracking_opted_out']
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
if attributes.key?(:'have_disabled_webhooks')
|
|
199
|
+
self.have_disabled_webhooks = attributes[:'have_disabled_webhooks']
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
if attributes.key?(:'circuit_state')
|
|
203
|
+
self.circuit_state = attributes[:'circuit_state']
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
if attributes.key?(:'reason')
|
|
207
|
+
self.reason = attributes[:'reason']
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
if attributes.key?(:'fails')
|
|
211
|
+
self.fails = attributes[:'fails']
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
if attributes.key?(:'trips')
|
|
215
|
+
self.trips = attributes[:'trips']
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
if attributes.key?(:'disabled_at')
|
|
219
|
+
self.disabled_at = attributes[:'disabled_at']
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
if attributes.key?(:'first_fail_at')
|
|
223
|
+
self.first_fail_at = attributes[:'first_fail_at']
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
if attributes.key?(:'last_status')
|
|
227
|
+
self.last_status = attributes[:'last_status']
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
if attributes.key?(:'next_probe_at')
|
|
231
|
+
self.next_probe_at = attributes[:'next_probe_at']
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
if attributes.key?(:'disabled_webhooks')
|
|
235
|
+
if (value = attributes[:'disabled_webhooks']).is_a?(Array)
|
|
236
|
+
self.disabled_webhooks = value
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
if attributes.key?(:'webhook_statuses')
|
|
241
|
+
if (value = attributes[:'webhook_statuses']).is_a?(Array)
|
|
242
|
+
self.webhook_statuses = value
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
248
|
+
# @return Array for valid properties with the reasons
|
|
249
|
+
def list_invalid_properties
|
|
250
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
251
|
+
invalid_properties = Array.new
|
|
252
|
+
invalid_properties
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# Check to see if the all the properties in the model are valid
|
|
256
|
+
# @return true if the model is valid
|
|
257
|
+
def valid?
|
|
258
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
259
|
+
circuit_state_validator = EnumAttributeValidator.new('String', ["ok", "degraded", "open", "half_open", "disabled"])
|
|
260
|
+
return false unless circuit_state_validator.valid?(@circuit_state)
|
|
261
|
+
true
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
265
|
+
# @param [Object] circuit_state Object to be assigned
|
|
266
|
+
def circuit_state=(circuit_state)
|
|
267
|
+
validator = EnumAttributeValidator.new('String', ["ok", "degraded", "open", "half_open", "disabled"])
|
|
268
|
+
unless validator.valid?(circuit_state)
|
|
269
|
+
fail ArgumentError, "invalid value for \"circuit_state\", must be one of #{validator.allowable_values}."
|
|
270
|
+
end
|
|
271
|
+
@circuit_state = circuit_state
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# Checks equality by comparing each attribute.
|
|
275
|
+
# @param [Object] Object to be compared
|
|
276
|
+
def ==(o)
|
|
277
|
+
return true if self.equal?(o)
|
|
278
|
+
self.class == o.class &&
|
|
279
|
+
webhook_url == o.webhook_url &&
|
|
280
|
+
guaranteed_hooks == o.guaranteed_hooks &&
|
|
281
|
+
ack_notifications_on == o.ack_notifications_on &&
|
|
282
|
+
raw_hooks == o.raw_hooks &&
|
|
283
|
+
mm_lite_enabled == o.mm_lite_enabled &&
|
|
284
|
+
template_analytics_enabled == o.template_analytics_enabled &&
|
|
285
|
+
cta_url_link_tracking_opted_out == o.cta_url_link_tracking_opted_out &&
|
|
286
|
+
have_disabled_webhooks == o.have_disabled_webhooks &&
|
|
287
|
+
circuit_state == o.circuit_state &&
|
|
288
|
+
reason == o.reason &&
|
|
289
|
+
fails == o.fails &&
|
|
290
|
+
trips == o.trips &&
|
|
291
|
+
disabled_at == o.disabled_at &&
|
|
292
|
+
first_fail_at == o.first_fail_at &&
|
|
293
|
+
last_status == o.last_status &&
|
|
294
|
+
next_probe_at == o.next_probe_at &&
|
|
295
|
+
disabled_webhooks == o.disabled_webhooks &&
|
|
296
|
+
webhook_statuses == o.webhook_statuses
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
# @see the `==` method
|
|
300
|
+
# @param [Object] Object to be compared
|
|
301
|
+
def eql?(o)
|
|
302
|
+
self == o
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
# Calculates hash code according to all attributes.
|
|
306
|
+
# @return [Integer] Hash code
|
|
307
|
+
def hash
|
|
308
|
+
[webhook_url, guaranteed_hooks, ack_notifications_on, raw_hooks, mm_lite_enabled, template_analytics_enabled, cta_url_link_tracking_opted_out, have_disabled_webhooks, circuit_state, reason, fails, trips, disabled_at, first_fail_at, last_status, next_probe_at, disabled_webhooks, webhook_statuses].hash
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
# Builds the object from hash
|
|
312
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
313
|
+
# @return [Object] Returns the model itself
|
|
314
|
+
def self.build_from_hash(attributes)
|
|
315
|
+
return nil unless attributes.is_a?(Hash)
|
|
316
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
317
|
+
transformed_hash = {}
|
|
318
|
+
openapi_types.each_pair do |key, type|
|
|
319
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
320
|
+
transformed_hash["#{key}"] = nil
|
|
321
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
322
|
+
# check to ensure the input is an array given that the attribute
|
|
323
|
+
# is documented as an array but the input is not
|
|
324
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
325
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
326
|
+
end
|
|
327
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
328
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
329
|
+
end
|
|
330
|
+
end
|
|
331
|
+
new(transformed_hash)
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
# Returns the object in the form of hash
|
|
335
|
+
# @return [Hash] Returns the object in the form of hash
|
|
336
|
+
def to_hash
|
|
337
|
+
hash = {}
|
|
338
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
339
|
+
value = self.send(attr)
|
|
340
|
+
if value.nil?
|
|
341
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
342
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
hash[param] = _to_hash(value)
|
|
346
|
+
end
|
|
347
|
+
hash
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
end
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#1MSG WhatsApp Business API (Public)
|
|
3
|
+
|
|
4
|
+
#Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** Pass the channel token in **one** place. The API checks JSON body (`token`), then query string (`?token=`), then `Authorization: Bearer` header (preferred in production). **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
|
7
|
+
Contact: support@1msg.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module OneMsgSdk
|
|
17
|
+
# One URL, or several if multiple webhooks are configured
|
|
18
|
+
module ListSettings200ResponseWebhookUrl
|
|
19
|
+
class << self
|
|
20
|
+
# List of class defined in oneOf (OpenAPI v3)
|
|
21
|
+
def openapi_one_of
|
|
22
|
+
[
|
|
23
|
+
:'Array<String>',
|
|
24
|
+
:'String'
|
|
25
|
+
]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Builds the object
|
|
29
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
|
30
|
+
# @return [Object] Returns the model or the data itself
|
|
31
|
+
def build(data)
|
|
32
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
|
33
|
+
# Note:
|
|
34
|
+
# - We do not attempt to check whether exactly one item matches.
|
|
35
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
36
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
37
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
38
|
+
# - TODO: logging when debugging is set.
|
|
39
|
+
openapi_one_of.each do |klass|
|
|
40
|
+
begin
|
|
41
|
+
next if klass == :AnyType # "nullable: true"
|
|
42
|
+
return find_and_cast_into_type(klass, data)
|
|
43
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
private
|
|
51
|
+
|
|
52
|
+
SchemaMismatchError = Class.new(StandardError)
|
|
53
|
+
|
|
54
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
55
|
+
def find_and_cast_into_type(klass, data)
|
|
56
|
+
return if data.nil?
|
|
57
|
+
|
|
58
|
+
case klass.to_s
|
|
59
|
+
when 'Boolean'
|
|
60
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
61
|
+
when 'Float'
|
|
62
|
+
return data if data.instance_of?(Float)
|
|
63
|
+
when 'Integer'
|
|
64
|
+
return data if data.instance_of?(Integer)
|
|
65
|
+
when 'Time'
|
|
66
|
+
return Time.parse(data)
|
|
67
|
+
when 'Date'
|
|
68
|
+
return Date.iso8601(data)
|
|
69
|
+
when 'String'
|
|
70
|
+
return data if data.instance_of?(String)
|
|
71
|
+
when 'Object' # "type: object"
|
|
72
|
+
return data if data.instance_of?(Hash)
|
|
73
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
74
|
+
if data.instance_of?(Array)
|
|
75
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
76
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
77
|
+
end
|
|
78
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
79
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
80
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
81
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
82
|
+
end
|
|
83
|
+
else # model
|
|
84
|
+
const = OneMsgSdk.const_get(klass)
|
|
85
|
+
if const
|
|
86
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
|
87
|
+
model = const.build(data)
|
|
88
|
+
return model if model
|
|
89
|
+
else
|
|
90
|
+
# raise if data contains keys that are not known to the model
|
|
91
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
92
|
+
model = const.build_from_hash(data)
|
|
93
|
+
return model if model
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
raise # if no match by now, raise
|
|
99
|
+
rescue
|
|
100
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
end
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#1MSG WhatsApp Business API (Public)
|
|
3
3
|
|
|
4
|
-
#Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:**
|
|
4
|
+
#Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** Pass the channel token in **one** place. The API checks JSON body (`token`), then query string (`?token=`), then `Authorization: Bearer` header (preferred in production). **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document:
|
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
|
7
7
|
Contact: support@1msg.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.22.0
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#1MSG WhatsApp Business API (Public)
|
|
3
3
|
|
|
4
|
-
#Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:**
|
|
4
|
+
#Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** Pass the channel token in **one** place. The API checks JSON body (`token`), then query string (`?token=`), then `Authorization: Bearer` header (preferred in production). **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document:
|
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
|
7
7
|
Contact: support@1msg.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.22.0
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#1MSG WhatsApp Business API (Public)
|
|
3
3
|
|
|
4
|
-
#Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:**
|
|
4
|
+
#Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** Pass the channel token in **one** place. The API checks JSON body (`token`), then query string (`?token=`), then `Authorization: Bearer` header (preferred in production). **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document:
|
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
|
7
7
|
Contact: support@1msg.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.22.0
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#1MSG WhatsApp Business API (Public)
|
|
3
|
+
|
|
4
|
+
#Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** Pass the channel token in **one** place. The API checks JSON body (`token`), then query string (`?token=`), then `Authorization: Bearer` header (preferred in production). **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
|
7
|
+
Contact: support@1msg.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module OneMsgSdk
|
|
17
|
+
class PatchFlowsFlowIdAssetsRequest < ApiModelBase
|
|
18
|
+
# WhatsApp Flow JSON document
|
|
19
|
+
attr_accessor :flow_json
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
:'flow_json' => :'flowJson'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns attribute mapping this model knows about
|
|
29
|
+
def self.acceptable_attribute_map
|
|
30
|
+
attribute_map
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
|
34
|
+
def self.acceptable_attributes
|
|
35
|
+
acceptable_attribute_map.values
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Attribute type mapping.
|
|
39
|
+
def self.openapi_types
|
|
40
|
+
{
|
|
41
|
+
:'flow_json' => :'Hash<String, Object>'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# List of attributes with nullable: true
|
|
46
|
+
def self.openapi_nullable
|
|
47
|
+
Set.new([
|
|
48
|
+
])
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Initializes the object
|
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
53
|
+
def initialize(attributes = {})
|
|
54
|
+
if (!attributes.is_a?(Hash))
|
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OneMsgSdk::PatchFlowsFlowIdAssetsRequest` initialize method"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OneMsgSdk::PatchFlowsFlowIdAssetsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
63
|
+
end
|
|
64
|
+
h[k.to_sym] = v
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if attributes.key?(:'flow_json')
|
|
68
|
+
if (value = attributes[:'flow_json']).is_a?(Hash)
|
|
69
|
+
self.flow_json = value
|
|
70
|
+
end
|
|
71
|
+
else
|
|
72
|
+
self.flow_json = nil
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
77
|
+
# @return Array for valid properties with the reasons
|
|
78
|
+
def list_invalid_properties
|
|
79
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
80
|
+
invalid_properties = Array.new
|
|
81
|
+
if @flow_json.nil?
|
|
82
|
+
invalid_properties.push('invalid value for "flow_json", flow_json cannot be nil.')
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
invalid_properties
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Check to see if the all the properties in the model are valid
|
|
89
|
+
# @return true if the model is valid
|
|
90
|
+
def valid?
|
|
91
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
92
|
+
return false if @flow_json.nil?
|
|
93
|
+
true
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Custom attribute writer method with validation
|
|
97
|
+
# @param [Object] flow_json Value to be assigned
|
|
98
|
+
def flow_json=(flow_json)
|
|
99
|
+
if flow_json.nil?
|
|
100
|
+
fail ArgumentError, 'flow_json cannot be nil'
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
@flow_json = flow_json
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Checks equality by comparing each attribute.
|
|
107
|
+
# @param [Object] Object to be compared
|
|
108
|
+
def ==(o)
|
|
109
|
+
return true if self.equal?(o)
|
|
110
|
+
self.class == o.class &&
|
|
111
|
+
flow_json == o.flow_json
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# @see the `==` method
|
|
115
|
+
# @param [Object] Object to be compared
|
|
116
|
+
def eql?(o)
|
|
117
|
+
self == o
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Calculates hash code according to all attributes.
|
|
121
|
+
# @return [Integer] Hash code
|
|
122
|
+
def hash
|
|
123
|
+
[flow_json].hash
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Builds the object from hash
|
|
127
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
128
|
+
# @return [Object] Returns the model itself
|
|
129
|
+
def self.build_from_hash(attributes)
|
|
130
|
+
return nil unless attributes.is_a?(Hash)
|
|
131
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
132
|
+
transformed_hash = {}
|
|
133
|
+
openapi_types.each_pair do |key, type|
|
|
134
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
135
|
+
transformed_hash["#{key}"] = nil
|
|
136
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
137
|
+
# check to ensure the input is an array given that the attribute
|
|
138
|
+
# is documented as an array but the input is not
|
|
139
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
140
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
141
|
+
end
|
|
142
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
143
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
new(transformed_hash)
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Returns the object in the form of hash
|
|
150
|
+
# @return [Hash] Returns the object in the form of hash
|
|
151
|
+
def to_hash
|
|
152
|
+
hash = {}
|
|
153
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
154
|
+
value = self.send(attr)
|
|
155
|
+
if value.nil?
|
|
156
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
157
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
hash[param] = _to_hash(value)
|
|
161
|
+
end
|
|
162
|
+
hash
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
end
|