zernio-sdk 0.0.543 → 0.0.545

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.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +53 -4
  3. data/docs/AdAudiencesApi.md +5 -5
  4. data/docs/AdCampaignsApi.md +142 -0
  5. data/docs/AdsApi.md +795 -37
  6. data/docs/CreateAdCampaign201Response.md +24 -0
  7. data/docs/CreateAdCampaignRequest.md +32 -0
  8. data/docs/CreateAdCreative201Response.md +20 -0
  9. data/docs/CreateAdCreativeRequest.md +40 -0
  10. data/docs/CreateAdCreativeRequestCarouselCardsInner.md +26 -0
  11. data/docs/CreateSmsSenderId200Response.md +22 -0
  12. data/docs/CreateSmsSenderIdRequest.md +18 -0
  13. data/docs/CreateStandaloneAd200Response.md +22 -0
  14. data/docs/CreateStandaloneAd200ResponseResultsInner.md +22 -0
  15. data/docs/CreateStandaloneAdRequest.md +4 -0
  16. data/docs/DeleteAdCreative200Response.md +20 -0
  17. data/docs/DeleteSmsSenderId200Response.md +18 -0
  18. data/docs/DiscordApi.md +153 -1
  19. data/docs/{ListDiscordGuildMembers200ResponseDataInner.md → DiscordGuildMember.md} +3 -3
  20. data/docs/{ListDiscordGuildMembers200ResponseDataInnerUser.md → DiscordGuildMemberUser.md} +2 -2
  21. data/docs/DuplicateAd200Response.md +22 -0
  22. data/docs/DuplicateAdRequest.md +28 -0
  23. data/docs/DuplicateAdSet200Response.md +22 -0
  24. data/docs/DuplicateAdSetRequest.md +36 -0
  25. data/docs/GetAdCreative200Response.md +18 -0
  26. data/docs/GetDiscordGuildMember200Response.md +18 -0
  27. data/docs/ListAdCreatives200Response.md +22 -0
  28. data/docs/ListAdImages200Response.md +22 -0
  29. data/docs/ListAdLabels200Response.md +22 -0
  30. data/docs/ListDiscordGuildMembers200Response.md +1 -1
  31. data/docs/ListHighDemandPeriods200Response.md +22 -0
  32. data/docs/ListMetaBusinesses200Response.md +20 -0
  33. data/docs/ListSmsSenderIds200Response.md +20 -0
  34. data/docs/ListSmsSenderIds200ResponseBudget.md +24 -0
  35. data/docs/ListSmsSenderIds200ResponseBudgetPendingRequest.md +22 -0
  36. data/docs/ListSmsSenderIds200ResponseSenderIdsInner.md +24 -0
  37. data/docs/RequestSmsSenderIdLimitIncrease200Response.md +20 -0
  38. data/docs/RequestSmsSenderIdLimitIncreaseRequest.md +20 -0
  39. data/docs/SMSApi.md +275 -0
  40. data/docs/SearchDiscordGuildMembers200Response.md +18 -0
  41. data/docs/UpdateAdCreative200Response.md +22 -0
  42. data/docs/UpdateAdCreativeRequest.md +20 -0
  43. data/docs/WhatsAppApi.md +72 -0
  44. data/lib/zernio-sdk/api/ad_audiences_api.rb +4 -4
  45. data/lib/zernio-sdk/api/ad_campaigns_api.rb +142 -0
  46. data/lib/zernio-sdk/api/ads_api.rb +829 -51
  47. data/lib/zernio-sdk/api/discord_api.rb +174 -2
  48. data/lib/zernio-sdk/api/sms_api.rb +254 -0
  49. data/lib/zernio-sdk/api/whats_app_api.rb +70 -0
  50. data/lib/zernio-sdk/models/create_ad_campaign201_response.rb +210 -0
  51. data/lib/zernio-sdk/models/create_ad_campaign_request.rb +343 -0
  52. data/lib/zernio-sdk/models/create_ad_creative201_response.rb +157 -0
  53. data/lib/zernio-sdk/models/create_ad_creative_request.rb +424 -0
  54. data/lib/zernio-sdk/models/create_ad_creative_request_carousel_cards_inner.rb +255 -0
  55. data/lib/zernio-sdk/models/create_sms_sender_id200_response.rb +166 -0
  56. data/lib/zernio-sdk/models/create_sms_sender_id_request.rb +183 -0
  57. data/lib/zernio-sdk/models/create_standalone_ad200_response.rb +201 -0
  58. data/lib/zernio-sdk/models/create_standalone_ad200_response_results_inner.rb +212 -0
  59. data/lib/zernio-sdk/models/create_standalone_ad_request.rb +23 -1
  60. data/lib/zernio-sdk/models/delete_ad_creative200_response.rb +156 -0
  61. data/lib/zernio-sdk/models/delete_sms_sender_id200_response.rb +147 -0
  62. data/lib/zernio-sdk/models/{list_discord_guild_members200_response_data_inner.rb → discord_guild_member.rb} +5 -4
  63. data/lib/zernio-sdk/models/{list_discord_guild_members200_response_data_inner_user.rb → discord_guild_member_user.rb} +3 -3
  64. data/lib/zernio-sdk/models/duplicate_ad200_response.rb +200 -0
  65. data/lib/zernio-sdk/models/duplicate_ad_request.rb +243 -0
  66. data/lib/zernio-sdk/models/duplicate_ad_set200_response.rb +201 -0
  67. data/lib/zernio-sdk/models/duplicate_ad_set_request.rb +302 -0
  68. data/lib/zernio-sdk/models/get_ad_creative200_response.rb +148 -0
  69. data/lib/zernio-sdk/models/get_discord_guild_member200_response.rb +147 -0
  70. data/lib/zernio-sdk/models/list_ad_creatives200_response.rb +167 -0
  71. data/lib/zernio-sdk/models/list_ad_images200_response.rb +167 -0
  72. data/lib/zernio-sdk/models/list_ad_labels200_response.rb +167 -0
  73. data/lib/zernio-sdk/models/list_discord_guild_members200_response.rb +1 -1
  74. data/lib/zernio-sdk/models/list_high_demand_periods200_response.rb +168 -0
  75. data/lib/zernio-sdk/models/list_meta_businesses200_response.rb +158 -0
  76. data/lib/zernio-sdk/models/list_sms_sender_ids200_response.rb +158 -0
  77. data/lib/zernio-sdk/models/list_sms_sender_ids200_response_budget.rb +178 -0
  78. data/lib/zernio-sdk/models/list_sms_sender_ids200_response_budget_pending_request.rb +167 -0
  79. data/lib/zernio-sdk/models/list_sms_sender_ids200_response_sender_ids_inner.rb +175 -0
  80. data/lib/zernio-sdk/models/request_sms_sender_id_limit_increase200_response.rb +156 -0
  81. data/lib/zernio-sdk/models/request_sms_sender_id_limit_increase_request.rb +210 -0
  82. data/lib/zernio-sdk/models/search_discord_guild_members200_response.rb +149 -0
  83. data/lib/zernio-sdk/models/update_ad_creative200_response.rb +165 -0
  84. data/lib/zernio-sdk/models/update_ad_creative_request.rb +200 -0
  85. data/lib/zernio-sdk/version.rb +1 -1
  86. data/lib/zernio-sdk.rb +33 -3
  87. data/openapi.yaml +741 -28
  88. data/spec/api/ad_audiences_api_spec.rb +2 -2
  89. data/spec/api/ad_campaigns_api_spec.rb +25 -0
  90. data/spec/api/ads_api_spec.rb +143 -1
  91. data/spec/api/discord_api_spec.rb +30 -1
  92. data/spec/api/sms_api_spec.rb +46 -0
  93. data/spec/api/whats_app_api_spec.rb +13 -0
  94. data/spec/models/create_ad_campaign201_response_spec.rb +58 -0
  95. data/spec/models/create_ad_campaign_request_spec.rb +94 -0
  96. data/spec/models/create_ad_creative201_response_spec.rb +42 -0
  97. data/spec/models/create_ad_creative_request_carousel_cards_inner_spec.rb +60 -0
  98. data/spec/models/create_ad_creative_request_spec.rb +106 -0
  99. data/spec/models/create_sms_sender_id200_response_spec.rb +48 -0
  100. data/spec/models/create_sms_sender_id_request_spec.rb +36 -0
  101. data/spec/models/create_standalone_ad200_response_results_inner_spec.rb +56 -0
  102. data/spec/models/create_standalone_ad200_response_spec.rb +52 -0
  103. data/spec/models/create_standalone_ad_request_spec.rb +16 -0
  104. data/spec/models/delete_ad_creative200_response_spec.rb +42 -0
  105. data/spec/models/delete_sms_sender_id200_response_spec.rb +36 -0
  106. data/spec/models/{list_discord_guild_members200_response_data_inner_spec.rb → discord_guild_member_spec.rb} +6 -6
  107. data/spec/models/{list_discord_guild_members200_response_data_inner_user_spec.rb → discord_guild_member_user_spec.rb} +6 -6
  108. data/spec/models/duplicate_ad200_response_spec.rb +52 -0
  109. data/spec/models/duplicate_ad_request_spec.rb +74 -0
  110. data/spec/models/duplicate_ad_set200_response_spec.rb +52 -0
  111. data/spec/models/duplicate_ad_set_request_spec.rb +102 -0
  112. data/spec/models/get_ad_creative200_response_spec.rb +36 -0
  113. data/spec/models/get_discord_guild_member200_response_spec.rb +36 -0
  114. data/spec/models/list_ad_creatives200_response_spec.rb +48 -0
  115. data/spec/models/list_ad_images200_response_spec.rb +48 -0
  116. data/spec/models/list_ad_labels200_response_spec.rb +48 -0
  117. data/spec/models/list_high_demand_periods200_response_spec.rb +48 -0
  118. data/spec/models/list_meta_businesses200_response_spec.rb +42 -0
  119. data/spec/models/list_sms_sender_ids200_response_budget_pending_request_spec.rb +48 -0
  120. data/spec/models/list_sms_sender_ids200_response_budget_spec.rb +54 -0
  121. data/spec/models/list_sms_sender_ids200_response_sender_ids_inner_spec.rb +54 -0
  122. data/spec/models/list_sms_sender_ids200_response_spec.rb +42 -0
  123. data/spec/models/request_sms_sender_id_limit_increase200_response_spec.rb +42 -0
  124. data/spec/models/request_sms_sender_id_limit_increase_request_spec.rb +42 -0
  125. data/spec/models/search_discord_guild_members200_response_spec.rb +36 -0
  126. data/spec/models/update_ad_creative200_response_spec.rb +48 -0
  127. data/spec/models/update_ad_creative_request_spec.rb +42 -0
  128. metadata +133 -13
  129. data/docs/InboxApi.md +0 -79
  130. data/lib/zernio-sdk/api/inbox_api.rb +0 -92
  131. data/spec/api/inbox_api_spec.rb +0 -48
@@ -791,6 +791,82 @@ module Zernio
791
791
  return data, status_code, headers
792
792
  end
793
793
 
794
+ # Get a Discord guild member
795
+ # Fetch a single guild member by Discord user id. Does not require the privileged Server Members Intent, so this works even where the full member listing returns 403.
796
+ # @param guild_id [String]
797
+ # @param user_id [String] Discord user snowflake.
798
+ # @param account_id [String]
799
+ # @param [Hash] opts the optional parameters
800
+ # @return [GetDiscordGuildMember200Response]
801
+ def get_discord_guild_member(guild_id, user_id, account_id, opts = {})
802
+ data, _status_code, _headers = get_discord_guild_member_with_http_info(guild_id, user_id, account_id, opts)
803
+ data
804
+ end
805
+
806
+ # Get a Discord guild member
807
+ # Fetch a single guild member by Discord user id. Does not require the privileged Server Members Intent, so this works even where the full member listing returns 403.
808
+ # @param guild_id [String]
809
+ # @param user_id [String] Discord user snowflake.
810
+ # @param account_id [String]
811
+ # @param [Hash] opts the optional parameters
812
+ # @return [Array<(GetDiscordGuildMember200Response, Integer, Hash)>] GetDiscordGuildMember200Response data, response status code and response headers
813
+ def get_discord_guild_member_with_http_info(guild_id, user_id, account_id, opts = {})
814
+ if @api_client.config.debugging
815
+ @api_client.config.logger.debug 'Calling API: DiscordApi.get_discord_guild_member ...'
816
+ end
817
+ # verify the required parameter 'guild_id' is set
818
+ if @api_client.config.client_side_validation && guild_id.nil?
819
+ fail ArgumentError, "Missing the required parameter 'guild_id' when calling DiscordApi.get_discord_guild_member"
820
+ end
821
+ # verify the required parameter 'user_id' is set
822
+ if @api_client.config.client_side_validation && user_id.nil?
823
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling DiscordApi.get_discord_guild_member"
824
+ end
825
+ # verify the required parameter 'account_id' is set
826
+ if @api_client.config.client_side_validation && account_id.nil?
827
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling DiscordApi.get_discord_guild_member"
828
+ end
829
+ # resource path
830
+ local_var_path = '/v1/discord/guilds/{guildId}/members/{userId}'.sub('{' + 'guildId' + '}', CGI.escape(guild_id.to_s)).sub('{' + 'userId' + '}', CGI.escape(user_id.to_s))
831
+
832
+ # query parameters
833
+ query_params = opts[:query_params] || {}
834
+ query_params[:'accountId'] = account_id
835
+
836
+ # header parameters
837
+ header_params = opts[:header_params] || {}
838
+ # HTTP header 'Accept' (if needed)
839
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
840
+
841
+ # form parameters
842
+ form_params = opts[:form_params] || {}
843
+
844
+ # http body (model)
845
+ post_body = opts[:debug_body]
846
+
847
+ # return_type
848
+ return_type = opts[:debug_return_type] || 'GetDiscordGuildMember200Response'
849
+
850
+ # auth_names
851
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
852
+
853
+ new_options = opts.merge(
854
+ :operation => :"DiscordApi.get_discord_guild_member",
855
+ :header_params => header_params,
856
+ :query_params => query_params,
857
+ :form_params => form_params,
858
+ :body => post_body,
859
+ :auth_names => auth_names,
860
+ :return_type => return_type
861
+ )
862
+
863
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
864
+ if @api_client.config.debugging
865
+ @api_client.config.logger.debug "API called: DiscordApi#get_discord_guild_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
866
+ end
867
+ return data, status_code, headers
868
+ end
869
+
794
870
  # Get a Discord scheduled event
795
871
  # @param guild_id [String]
796
872
  # @param event_id [String]
@@ -929,7 +1005,7 @@ module Zernio
929
1005
  end
930
1006
 
931
1007
  # List Discord guild members
932
- # Cursor-paginated list of guild members. Returns Discord's raw member objects so callers can build community-ops automation (e.g. \"add role to all members joined in the last 7 days\") on the actual platform shape. **Important:** this endpoint requires the privileged \"Server Members Intent\" enabled on the Discord app (Developer Portal Bot tab toggle \"Server Members Intent\" ON, then Save). Without it, Discord returns an empty array with no error. Verify the intent is enabled before relying on this endpoint. Pagination: pass `after` = the last `user.id` from the previous page. Omit on the first call. Response includes a `nextCursor` and `hasMore` flag so callers don't need to know Discord's pagination shape.
1008
+ # Cursor-paginated list of guild members. Returns Discord's raw member objects so callers can build community-ops automation (e.g. \"add role to all members joined in the last 7 days\") on the actual platform shape. **Important:** this endpoint requires the privileged \"Server Members Intent\" on the Discord application. If the intent is not enabled, Discord rejects the call and this endpoint returns **403**. Single member lookup and prefix search (see the sibling endpoints) do not need the intent. Pagination: pass `after` = the last `user.id` from the previous page. Omit on the first call. Response includes a `nextCursor` and `hasMore` flag so callers don't need to know Discord's pagination shape.
933
1009
  # @param guild_id [String]
934
1010
  # @param account_id [String]
935
1011
  # @param [Hash] opts the optional parameters
@@ -942,7 +1018,7 @@ module Zernio
942
1018
  end
943
1019
 
944
1020
  # List Discord guild members
945
- # Cursor-paginated list of guild members. Returns Discord&#39;s raw member objects so callers can build community-ops automation (e.g. \&quot;add role to all members joined in the last 7 days\&quot;) on the actual platform shape. **Important:** this endpoint requires the privileged \&quot;Server Members Intent\&quot; enabled on the Discord app (Developer Portal Bot tab toggle \&quot;Server Members Intent\&quot; ON, then Save). Without it, Discord returns an empty array with no error. Verify the intent is enabled before relying on this endpoint. Pagination: pass &#x60;after&#x60; &#x3D; the last &#x60;user.id&#x60; from the previous page. Omit on the first call. Response includes a &#x60;nextCursor&#x60; and &#x60;hasMore&#x60; flag so callers don&#39;t need to know Discord&#39;s pagination shape.
1021
+ # Cursor-paginated list of guild members. Returns Discord&#39;s raw member objects so callers can build community-ops automation (e.g. \&quot;add role to all members joined in the last 7 days\&quot;) on the actual platform shape. **Important:** this endpoint requires the privileged \&quot;Server Members Intent\&quot; on the Discord application. If the intent is not enabled, Discord rejects the call and this endpoint returns **403**. Single member lookup and prefix search (see the sibling endpoints) do not need the intent. Pagination: pass &#x60;after&#x60; &#x3D; the last &#x60;user.id&#x60; from the previous page. Omit on the first call. Response includes a &#x60;nextCursor&#x60; and &#x60;hasMore&#x60; flag so callers don&#39;t need to know Discord&#39;s pagination shape.
946
1022
  # @param guild_id [String]
947
1023
  # @param account_id [String]
948
1024
  # @param [Hash] opts the optional parameters
@@ -1383,6 +1459,102 @@ module Zernio
1383
1459
  return data, status_code, headers
1384
1460
  end
1385
1461
 
1462
+ # Search Discord guild members
1463
+ # Search guild members whose username or nickname **starts with** the query (Discord matches prefixes only, not substrings). Does not require the privileged Server Members Intent, so this works even where the full member listing returns 403.
1464
+ # @param guild_id [String]
1465
+ # @param account_id [String]
1466
+ # @param query [String] Username or nickname prefix to match.
1467
+ # @param [Hash] opts the optional parameters
1468
+ # @option opts [Integer] :limit (default to 25)
1469
+ # @return [SearchDiscordGuildMembers200Response]
1470
+ def search_discord_guild_members(guild_id, account_id, query, opts = {})
1471
+ data, _status_code, _headers = search_discord_guild_members_with_http_info(guild_id, account_id, query, opts)
1472
+ data
1473
+ end
1474
+
1475
+ # Search Discord guild members
1476
+ # Search guild members whose username or nickname **starts with** the query (Discord matches prefixes only, not substrings). Does not require the privileged Server Members Intent, so this works even where the full member listing returns 403.
1477
+ # @param guild_id [String]
1478
+ # @param account_id [String]
1479
+ # @param query [String] Username or nickname prefix to match.
1480
+ # @param [Hash] opts the optional parameters
1481
+ # @option opts [Integer] :limit (default to 25)
1482
+ # @return [Array<(SearchDiscordGuildMembers200Response, Integer, Hash)>] SearchDiscordGuildMembers200Response data, response status code and response headers
1483
+ def search_discord_guild_members_with_http_info(guild_id, account_id, query, opts = {})
1484
+ if @api_client.config.debugging
1485
+ @api_client.config.logger.debug 'Calling API: DiscordApi.search_discord_guild_members ...'
1486
+ end
1487
+ # verify the required parameter 'guild_id' is set
1488
+ if @api_client.config.client_side_validation && guild_id.nil?
1489
+ fail ArgumentError, "Missing the required parameter 'guild_id' when calling DiscordApi.search_discord_guild_members"
1490
+ end
1491
+ # verify the required parameter 'account_id' is set
1492
+ if @api_client.config.client_side_validation && account_id.nil?
1493
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling DiscordApi.search_discord_guild_members"
1494
+ end
1495
+ # verify the required parameter 'query' is set
1496
+ if @api_client.config.client_side_validation && query.nil?
1497
+ fail ArgumentError, "Missing the required parameter 'query' when calling DiscordApi.search_discord_guild_members"
1498
+ end
1499
+ if @api_client.config.client_side_validation && query.to_s.length > 100
1500
+ fail ArgumentError, 'invalid value for "query" when calling DiscordApi.search_discord_guild_members, the character length must be smaller than or equal to 100.'
1501
+ end
1502
+
1503
+ if @api_client.config.client_side_validation && query.to_s.length < 1
1504
+ fail ArgumentError, 'invalid value for "query" when calling DiscordApi.search_discord_guild_members, the character length must be greater than or equal to 1.'
1505
+ end
1506
+
1507
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
1508
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DiscordApi.search_discord_guild_members, must be smaller than or equal to 1000.'
1509
+ end
1510
+
1511
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
1512
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DiscordApi.search_discord_guild_members, must be greater than or equal to 1.'
1513
+ end
1514
+
1515
+ # resource path
1516
+ local_var_path = '/v1/discord/guilds/{guildId}/members/search'.sub('{' + 'guildId' + '}', CGI.escape(guild_id.to_s))
1517
+
1518
+ # query parameters
1519
+ query_params = opts[:query_params] || {}
1520
+ query_params[:'accountId'] = account_id
1521
+ query_params[:'query'] = query
1522
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1523
+
1524
+ # header parameters
1525
+ header_params = opts[:header_params] || {}
1526
+ # HTTP header 'Accept' (if needed)
1527
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1528
+
1529
+ # form parameters
1530
+ form_params = opts[:form_params] || {}
1531
+
1532
+ # http body (model)
1533
+ post_body = opts[:debug_body]
1534
+
1535
+ # return_type
1536
+ return_type = opts[:debug_return_type] || 'SearchDiscordGuildMembers200Response'
1537
+
1538
+ # auth_names
1539
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1540
+
1541
+ new_options = opts.merge(
1542
+ :operation => :"DiscordApi.search_discord_guild_members",
1543
+ :header_params => header_params,
1544
+ :query_params => query_params,
1545
+ :form_params => form_params,
1546
+ :body => post_body,
1547
+ :auth_names => auth_names,
1548
+ :return_type => return_type
1549
+ )
1550
+
1551
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1552
+ if @api_client.config.debugging
1553
+ @api_client.config.logger.debug "API called: DiscordApi#search_discord_guild_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1554
+ end
1555
+ return data, status_code, headers
1556
+ end
1557
+
1386
1558
  # Send a Discord Direct Message
1387
1559
  # Send a 1:1 Direct Message from the bot to a Discord user (by snowflake ID). Supports the same payload shape as channel posts — content, embeds, media attachments, and TTS. Constraints (Discord platform limits): - The bot can only DM users it shares at least one guild with. - If the recipient has DMs disabled for non-friends, Discord returns 403 (surfaces as a 502 platform error). - `content` capped at 2,000 chars. - At least one of `content`, `embeds`, or `attachments` is required. - The recipient must be identified by Discord snowflake ID (not username). This is a dedicated endpoint rather than a `POST /v1/posts` variant because DMs are 1:1 operational messages (onboarding, billing reminders, support pings) with a different lifecycle than scheduled channel posts. DMs are not persisted to `Post` / `ExternalPost` and are always sent immediately.
1388
1560
  # @param send_discord_direct_message_request [SendDiscordDirectMessageRequest]
@@ -93,6 +93,74 @@ module Zernio
93
93
  return data, status_code, headers
94
94
  end
95
95
 
96
+ # Create an alphanumeric sender ID
97
+ # Registers an alphanumeric sender ID (e.g. `ZERNIO`) — a branded `from` for one-way international SMS. No phone number purchase or carrier registration is needed; once created, pass it as `from` on `POST /v1/sms/messages`. Constraints: 3-11 characters (letters, digits, spaces; at least one letter). Sends cannot reach the US, Canada, or Puerto Rico, are text-only, and recipients cannot reply. Sender IDs that impersonate well-known brands or institutions are rejected, and an ID already registered by another workspace returns 409 (active sender IDs are globally unique, first-come-first-served). Creating the same sender ID again is a no-op (re-activates it after a delete).
98
+ # @param create_sms_sender_id_request [CreateSmsSenderIdRequest]
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [CreateSmsSenderId200Response]
101
+ def create_sms_sender_id(create_sms_sender_id_request, opts = {})
102
+ data, _status_code, _headers = create_sms_sender_id_with_http_info(create_sms_sender_id_request, opts)
103
+ data
104
+ end
105
+
106
+ # Create an alphanumeric sender ID
107
+ # Registers an alphanumeric sender ID (e.g. &#x60;ZERNIO&#x60;) — a branded &#x60;from&#x60; for one-way international SMS. No phone number purchase or carrier registration is needed; once created, pass it as &#x60;from&#x60; on &#x60;POST /v1/sms/messages&#x60;. Constraints: 3-11 characters (letters, digits, spaces; at least one letter). Sends cannot reach the US, Canada, or Puerto Rico, are text-only, and recipients cannot reply. Sender IDs that impersonate well-known brands or institutions are rejected, and an ID already registered by another workspace returns 409 (active sender IDs are globally unique, first-come-first-served). Creating the same sender ID again is a no-op (re-activates it after a delete).
108
+ # @param create_sms_sender_id_request [CreateSmsSenderIdRequest]
109
+ # @param [Hash] opts the optional parameters
110
+ # @return [Array<(CreateSmsSenderId200Response, Integer, Hash)>] CreateSmsSenderId200Response data, response status code and response headers
111
+ def create_sms_sender_id_with_http_info(create_sms_sender_id_request, opts = {})
112
+ if @api_client.config.debugging
113
+ @api_client.config.logger.debug 'Calling API: SMSApi.create_sms_sender_id ...'
114
+ end
115
+ # verify the required parameter 'create_sms_sender_id_request' is set
116
+ if @api_client.config.client_side_validation && create_sms_sender_id_request.nil?
117
+ fail ArgumentError, "Missing the required parameter 'create_sms_sender_id_request' when calling SMSApi.create_sms_sender_id"
118
+ end
119
+ # resource path
120
+ local_var_path = '/v1/sms/sender-ids'
121
+
122
+ # query parameters
123
+ query_params = opts[:query_params] || {}
124
+
125
+ # header parameters
126
+ header_params = opts[:header_params] || {}
127
+ # HTTP header 'Accept' (if needed)
128
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
129
+ # HTTP header 'Content-Type'
130
+ content_type = @api_client.select_header_content_type(['application/json'])
131
+ if !content_type.nil?
132
+ header_params['Content-Type'] = content_type
133
+ end
134
+
135
+ # form parameters
136
+ form_params = opts[:form_params] || {}
137
+
138
+ # http body (model)
139
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_sms_sender_id_request)
140
+
141
+ # return_type
142
+ return_type = opts[:debug_return_type] || 'CreateSmsSenderId200Response'
143
+
144
+ # auth_names
145
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
146
+
147
+ new_options = opts.merge(
148
+ :operation => :"SMSApi.create_sms_sender_id",
149
+ :header_params => header_params,
150
+ :query_params => query_params,
151
+ :form_params => form_params,
152
+ :body => post_body,
153
+ :auth_names => auth_names,
154
+ :return_type => return_type
155
+ )
156
+
157
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
158
+ if @api_client.config.debugging
159
+ @api_client.config.logger.debug "API called: SMSApi#create_sms_sender_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
160
+ end
161
+ return data, status_code, headers
162
+ end
163
+
96
164
  # Deactivate a brand/campaign registration
97
165
  # Terminates the campaign with the carrier registry so the recurring monthly campaign fee stops (carriers bill the first 3 months of a campaign regardless). Numbers covered by it can no longer SEND texts — receiving is unaffected — until they're registered under a new brand. Irreversible: a deactivated campaign cannot be restored; texting again later requires a new registration (new one-time and review fees). Idempotent.
98
166
  # @param id [String]
@@ -156,6 +224,69 @@ module Zernio
156
224
  return data, status_code, headers
157
225
  end
158
226
 
227
+ # Delete an alphanumeric sender ID
228
+ # Deactivates the sender ID so it can no longer send. Re-creating the same sender ID via `POST /v1/sms/sender-ids` re-activates it.
229
+ # @param id [String] Sender ID resource id.
230
+ # @param [Hash] opts the optional parameters
231
+ # @return [DeleteSmsSenderId200Response]
232
+ def delete_sms_sender_id(id, opts = {})
233
+ data, _status_code, _headers = delete_sms_sender_id_with_http_info(id, opts)
234
+ data
235
+ end
236
+
237
+ # Delete an alphanumeric sender ID
238
+ # Deactivates the sender ID so it can no longer send. Re-creating the same sender ID via &#x60;POST /v1/sms/sender-ids&#x60; re-activates it.
239
+ # @param id [String] Sender ID resource id.
240
+ # @param [Hash] opts the optional parameters
241
+ # @return [Array<(DeleteSmsSenderId200Response, Integer, Hash)>] DeleteSmsSenderId200Response data, response status code and response headers
242
+ def delete_sms_sender_id_with_http_info(id, opts = {})
243
+ if @api_client.config.debugging
244
+ @api_client.config.logger.debug 'Calling API: SMSApi.delete_sms_sender_id ...'
245
+ end
246
+ # verify the required parameter 'id' is set
247
+ if @api_client.config.client_side_validation && id.nil?
248
+ fail ArgumentError, "Missing the required parameter 'id' when calling SMSApi.delete_sms_sender_id"
249
+ end
250
+ # resource path
251
+ local_var_path = '/v1/sms/sender-ids/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
252
+
253
+ # query parameters
254
+ query_params = opts[:query_params] || {}
255
+
256
+ # header parameters
257
+ header_params = opts[:header_params] || {}
258
+ # HTTP header 'Accept' (if needed)
259
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
260
+
261
+ # form parameters
262
+ form_params = opts[:form_params] || {}
263
+
264
+ # http body (model)
265
+ post_body = opts[:debug_body]
266
+
267
+ # return_type
268
+ return_type = opts[:debug_return_type] || 'DeleteSmsSenderId200Response'
269
+
270
+ # auth_names
271
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
272
+
273
+ new_options = opts.merge(
274
+ :operation => :"SMSApi.delete_sms_sender_id",
275
+ :header_params => header_params,
276
+ :query_params => query_params,
277
+ :form_params => form_params,
278
+ :body => post_body,
279
+ :auth_names => auth_names,
280
+ :return_type => return_type
281
+ )
282
+
283
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
284
+ if @api_client.config.debugging
285
+ @api_client.config.logger.debug "API called: SMSApi#delete_sms_sender_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
286
+ end
287
+ return data, status_code, headers
288
+ end
289
+
159
290
  # Disable SMS on a number
160
291
  # Turns off SMS for the number (deactivates its SMS account). The carrier registration is untouched, so re-enabling later just reactivates it, with no re-registration.
161
292
  # @param id [String]
@@ -478,6 +609,61 @@ module Zernio
478
609
  return data, status_code, headers
479
610
  end
480
611
 
612
+ # List alphanumeric sender IDs
613
+ # @param [Hash] opts the optional parameters
614
+ # @return [ListSmsSenderIds200Response]
615
+ def list_sms_sender_ids(opts = {})
616
+ data, _status_code, _headers = list_sms_sender_ids_with_http_info(opts)
617
+ data
618
+ end
619
+
620
+ # List alphanumeric sender IDs
621
+ # @param [Hash] opts the optional parameters
622
+ # @return [Array<(ListSmsSenderIds200Response, Integer, Hash)>] ListSmsSenderIds200Response data, response status code and response headers
623
+ def list_sms_sender_ids_with_http_info(opts = {})
624
+ if @api_client.config.debugging
625
+ @api_client.config.logger.debug 'Calling API: SMSApi.list_sms_sender_ids ...'
626
+ end
627
+ # resource path
628
+ local_var_path = '/v1/sms/sender-ids'
629
+
630
+ # query parameters
631
+ query_params = opts[:query_params] || {}
632
+
633
+ # header parameters
634
+ header_params = opts[:header_params] || {}
635
+ # HTTP header 'Accept' (if needed)
636
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
637
+
638
+ # form parameters
639
+ form_params = opts[:form_params] || {}
640
+
641
+ # http body (model)
642
+ post_body = opts[:debug_body]
643
+
644
+ # return_type
645
+ return_type = opts[:debug_return_type] || 'ListSmsSenderIds200Response'
646
+
647
+ # auth_names
648
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
649
+
650
+ new_options = opts.merge(
651
+ :operation => :"SMSApi.list_sms_sender_ids",
652
+ :header_params => header_params,
653
+ :query_params => query_params,
654
+ :form_params => form_params,
655
+ :body => post_body,
656
+ :auth_names => auth_names,
657
+ :return_type => return_type
658
+ )
659
+
660
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
661
+ if @api_client.config.debugging
662
+ @api_client.config.logger.debug "API called: SMSApi#list_sms_sender_ids\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
663
+ end
664
+ return data, status_code, headers
665
+ end
666
+
481
667
  # Look up carrier + line type
482
668
  # Carrier name and line type (mobile / landline / voip / toll-free) for a number, plus `smsReachable` (landlines can't receive SMS). Use it to validate recipients before sending. Each lookup is billed by the carrier-data provider, so call it explicitly (e.g. pre-validating an opt-in list), not on every send.
483
669
  # @param number [String] Number to look up (E.164; formatting is normalized).
@@ -546,6 +732,74 @@ module Zernio
546
732
  return data, status_code, headers
547
733
  end
548
734
 
735
+ # Request a higher sender ID daily limit
736
+ # Asks support to raise the workspace's daily sender-ID message cap. There is no self-serve raise: the request (desired cap + use case) is reviewed manually, usually within a business day.
737
+ # @param request_sms_sender_id_limit_increase_request [RequestSmsSenderIdLimitIncreaseRequest]
738
+ # @param [Hash] opts the optional parameters
739
+ # @return [RequestSmsSenderIdLimitIncrease200Response]
740
+ def request_sms_sender_id_limit_increase(request_sms_sender_id_limit_increase_request, opts = {})
741
+ data, _status_code, _headers = request_sms_sender_id_limit_increase_with_http_info(request_sms_sender_id_limit_increase_request, opts)
742
+ data
743
+ end
744
+
745
+ # Request a higher sender ID daily limit
746
+ # Asks support to raise the workspace&#39;s daily sender-ID message cap. There is no self-serve raise: the request (desired cap + use case) is reviewed manually, usually within a business day.
747
+ # @param request_sms_sender_id_limit_increase_request [RequestSmsSenderIdLimitIncreaseRequest]
748
+ # @param [Hash] opts the optional parameters
749
+ # @return [Array<(RequestSmsSenderIdLimitIncrease200Response, Integer, Hash)>] RequestSmsSenderIdLimitIncrease200Response data, response status code and response headers
750
+ def request_sms_sender_id_limit_increase_with_http_info(request_sms_sender_id_limit_increase_request, opts = {})
751
+ if @api_client.config.debugging
752
+ @api_client.config.logger.debug 'Calling API: SMSApi.request_sms_sender_id_limit_increase ...'
753
+ end
754
+ # verify the required parameter 'request_sms_sender_id_limit_increase_request' is set
755
+ if @api_client.config.client_side_validation && request_sms_sender_id_limit_increase_request.nil?
756
+ fail ArgumentError, "Missing the required parameter 'request_sms_sender_id_limit_increase_request' when calling SMSApi.request_sms_sender_id_limit_increase"
757
+ end
758
+ # resource path
759
+ local_var_path = '/v1/sms/sender-ids/limit-request'
760
+
761
+ # query parameters
762
+ query_params = opts[:query_params] || {}
763
+
764
+ # header parameters
765
+ header_params = opts[:header_params] || {}
766
+ # HTTP header 'Accept' (if needed)
767
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
768
+ # HTTP header 'Content-Type'
769
+ content_type = @api_client.select_header_content_type(['application/json'])
770
+ if !content_type.nil?
771
+ header_params['Content-Type'] = content_type
772
+ end
773
+
774
+ # form parameters
775
+ form_params = opts[:form_params] || {}
776
+
777
+ # http body (model)
778
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(request_sms_sender_id_limit_increase_request)
779
+
780
+ # return_type
781
+ return_type = opts[:debug_return_type] || 'RequestSmsSenderIdLimitIncrease200Response'
782
+
783
+ # auth_names
784
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
785
+
786
+ new_options = opts.merge(
787
+ :operation => :"SMSApi.request_sms_sender_id_limit_increase",
788
+ :header_params => header_params,
789
+ :query_params => query_params,
790
+ :form_params => form_params,
791
+ :body => post_body,
792
+ :auth_names => auth_names,
793
+ :return_type => return_type
794
+ )
795
+
796
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
797
+ if @api_client.config.debugging
798
+ @api_client.config.logger.debug "API called: SMSApi#request_sms_sender_id_limit_increase\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
799
+ end
800
+ return data, status_code, headers
801
+ end
802
+
549
803
  # Re-send the sole-prop OTP
550
804
  # Re-sends the sole-proprietor verification PIN to the brand's mobile number — use it when the original code expired or never arrived. Only valid while the registration is pending and awaiting its OTP; rate limited to one send per minute.
551
805
  # @param id [String]
@@ -1142,6 +1142,76 @@ module Zernio
1142
1142
  return data, status_code, headers
1143
1143
  end
1144
1144
 
1145
+ # Download WhatsApp media
1146
+ # Streams the binary for a WhatsApp attachment. This is the endpoint the `url` on a WhatsApp `attachments[]` entry points at, in both the `message.received` webhook and the List messages response. **This is an authenticated endpoint, not a public link.** Send `Authorization: Bearer <your API key>` exactly as you would for any other call. Passing the URL straight to a browser, an LLM vision API, or a no-code \"download file\" step without the header returns `401`. This is the most common integration mistake on this endpoint, and it differs from Instagram, Facebook and Telegram, whose `attachments[].url` is a direct CDN link that needs no header. **Fetch on receipt, not lazily.** WhatsApp media lives in Meta's media store, not ours, and it is removed after a limited retention window (currently 7 days, and Meta has been dropping some inbound media sooner). Once Meta drops it the media is unrecoverable and this endpoint answers `400` permanently, so retrying will never succeed. Download and store the bytes when the webhook arrives.
1147
+ # @param media_id [String] The media id from &#x60;attachments[].payload.id&#x60;.
1148
+ # @param account_id [String] The WhatsApp account that received the media.
1149
+ # @param [Hash] opts the optional parameters
1150
+ # @return [File]
1151
+ def get_whats_app_media(media_id, account_id, opts = {})
1152
+ data, _status_code, _headers = get_whats_app_media_with_http_info(media_id, account_id, opts)
1153
+ data
1154
+ end
1155
+
1156
+ # Download WhatsApp media
1157
+ # Streams the binary for a WhatsApp attachment. This is the endpoint the &#x60;url&#x60; on a WhatsApp &#x60;attachments[]&#x60; entry points at, in both the &#x60;message.received&#x60; webhook and the List messages response. **This is an authenticated endpoint, not a public link.** Send &#x60;Authorization: Bearer &lt;your API key&gt;&#x60; exactly as you would for any other call. Passing the URL straight to a browser, an LLM vision API, or a no-code \&quot;download file\&quot; step without the header returns &#x60;401&#x60;. This is the most common integration mistake on this endpoint, and it differs from Instagram, Facebook and Telegram, whose &#x60;attachments[].url&#x60; is a direct CDN link that needs no header. **Fetch on receipt, not lazily.** WhatsApp media lives in Meta&#39;s media store, not ours, and it is removed after a limited retention window (currently 7 days, and Meta has been dropping some inbound media sooner). Once Meta drops it the media is unrecoverable and this endpoint answers &#x60;400&#x60; permanently, so retrying will never succeed. Download and store the bytes when the webhook arrives.
1158
+ # @param media_id [String] The media id from &#x60;attachments[].payload.id&#x60;.
1159
+ # @param account_id [String] The WhatsApp account that received the media.
1160
+ # @param [Hash] opts the optional parameters
1161
+ # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
1162
+ def get_whats_app_media_with_http_info(media_id, account_id, opts = {})
1163
+ if @api_client.config.debugging
1164
+ @api_client.config.logger.debug 'Calling API: WhatsAppApi.get_whats_app_media ...'
1165
+ end
1166
+ # verify the required parameter 'media_id' is set
1167
+ if @api_client.config.client_side_validation && media_id.nil?
1168
+ fail ArgumentError, "Missing the required parameter 'media_id' when calling WhatsAppApi.get_whats_app_media"
1169
+ end
1170
+ # verify the required parameter 'account_id' is set
1171
+ if @api_client.config.client_side_validation && account_id.nil?
1172
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling WhatsAppApi.get_whats_app_media"
1173
+ end
1174
+ # resource path
1175
+ local_var_path = '/v1/whatsapp/media/{mediaId}'.sub('{' + 'mediaId' + '}', CGI.escape(media_id.to_s))
1176
+
1177
+ # query parameters
1178
+ query_params = opts[:query_params] || {}
1179
+ query_params[:'accountId'] = account_id
1180
+
1181
+ # header parameters
1182
+ header_params = opts[:header_params] || {}
1183
+ # HTTP header 'Accept' (if needed)
1184
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json']) unless header_params['Accept']
1185
+
1186
+ # form parameters
1187
+ form_params = opts[:form_params] || {}
1188
+
1189
+ # http body (model)
1190
+ post_body = opts[:debug_body]
1191
+
1192
+ # return_type
1193
+ return_type = opts[:debug_return_type] || 'File'
1194
+
1195
+ # auth_names
1196
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1197
+
1198
+ new_options = opts.merge(
1199
+ :operation => :"WhatsAppApi.get_whats_app_media",
1200
+ :header_params => header_params,
1201
+ :query_params => query_params,
1202
+ :form_params => form_params,
1203
+ :body => post_body,
1204
+ :auth_names => auth_names,
1205
+ :return_type => return_type
1206
+ )
1207
+
1208
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1209
+ if @api_client.config.debugging
1210
+ @api_client.config.logger.debug "API called: WhatsAppApi#get_whats_app_media\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1211
+ end
1212
+ return data, status_code, headers
1213
+ end
1214
+
1145
1215
  # Get template
1146
1216
  # Retrieve a single message template by name.
1147
1217
  # @param template_name [String] Template name