late-sdk 0.0.790 → 0.0.792
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/README.md +10 -0
- data/docs/DeleteWhatsAppTemplate200Response.md +24 -0
- data/docs/DeleteWhatsAppTemplateById200Response.md +24 -0
- data/docs/GetWhatsAppTemplate200ResponseTemplate.md +7 -3
- data/docs/GetWhatsAppTemplate409Response.md +26 -0
- data/docs/GetWhatsAppTemplate409ResponseDetails.md +18 -0
- data/docs/LinkedInMentionsApi.md +1 -1
- data/docs/UpdateWhatsAppTemplate200ResponseTemplate.md +3 -1
- data/docs/UpdateWhatsAppTemplateById200Response.md +20 -0
- data/docs/UpdateWhatsAppTemplateById200ResponseTemplate.md +24 -0
- data/docs/UpdateWhatsAppTemplateByIdRequest.md +20 -0
- data/docs/UpdateWhatsAppTemplateRequest.md +2 -0
- data/docs/WhatsAppApi.md +256 -24
- data/lib/zernio-sdk/api/linked_in_mentions_api.rb +2 -2
- data/lib/zernio-sdk/api/whats_app_api.rb +250 -17
- data/lib/zernio-sdk/models/delete_whats_app_template200_response.rb +210 -0
- data/lib/zernio-sdk/models/delete_whats_app_template_by_id200_response.rb +208 -0
- data/lib/zernio-sdk/models/get_whats_app_template200_response_template.rb +26 -4
- data/lib/zernio-sdk/models/get_whats_app_template409_response.rb +241 -0
- data/lib/zernio-sdk/models/get_whats_app_template409_response_details.rb +149 -0
- data/lib/zernio-sdk/models/update_whats_app_template200_response_template.rb +12 -1
- data/lib/zernio-sdk/models/update_whats_app_template_by_id200_response.rb +156 -0
- data/lib/zernio-sdk/models/update_whats_app_template_by_id200_response_template.rb +175 -0
- data/lib/zernio-sdk/models/update_whats_app_template_by_id_request.rb +203 -0
- data/lib/zernio-sdk/models/update_whats_app_template_request.rb +11 -1
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +7 -0
- data/openapi.yaml +288 -36
- data/spec/api/linked_in_mentions_api_spec.rb +1 -1
- data/spec/api/whats_app_api_spec.rb +52 -8
- data/spec/models/delete_whats_app_template200_response_spec.rb +58 -0
- data/spec/models/delete_whats_app_template_by_id200_response_spec.rb +58 -0
- data/spec/models/get_whats_app_template200_response_template_spec.rb +12 -0
- data/spec/models/get_whats_app_template409_response_details_spec.rb +36 -0
- data/spec/models/get_whats_app_template409_response_spec.rb +72 -0
- data/spec/models/update_whats_app_template200_response_template_spec.rb +6 -0
- data/spec/models/update_whats_app_template_by_id200_response_spec.rb +42 -0
- data/spec/models/update_whats_app_template_by_id200_response_template_spec.rb +54 -0
- data/spec/models/update_whats_app_template_by_id_request_spec.rb +42 -0
- data/spec/models/update_whats_app_template_request_spec.rb +6 -0
- data/zernio-sdk-0.0.792.gem +0 -0
- metadata +31 -3
- data/zernio-sdk-0.0.790.gem +0 -0
|
@@ -594,22 +594,24 @@ module Zernio
|
|
|
594
594
|
end
|
|
595
595
|
|
|
596
596
|
# Delete template
|
|
597
|
-
# Permanently delete a message template by name.
|
|
598
|
-
# @param template_name [String] Template name
|
|
597
|
+
# Permanently delete a message template. **Without `language` this deletes every language variant of the name** (Meta's own contract for deletion by name). Pass `language` to delete one variant only; the response `scope` says which happened. Meta keeps a deleted approved template in `PENDING_DELETION` for a while and the name cannot be reused for 30 days.
|
|
598
|
+
# @param template_name [String] Template name (the family).
|
|
599
599
|
# @param account_id [String] WhatsApp social account ID
|
|
600
600
|
# @param [Hash] opts the optional parameters
|
|
601
|
-
# @
|
|
601
|
+
# @option opts [String] :language Delete only this language variant (e.g. es). Omit to delete the whole family.
|
|
602
|
+
# @return [DeleteWhatsAppTemplate200Response]
|
|
602
603
|
def delete_whats_app_template(template_name, account_id, opts = {})
|
|
603
604
|
data, _status_code, _headers = delete_whats_app_template_with_http_info(template_name, account_id, opts)
|
|
604
605
|
data
|
|
605
606
|
end
|
|
606
607
|
|
|
607
608
|
# Delete template
|
|
608
|
-
# Permanently delete a message template by name.
|
|
609
|
-
# @param template_name [String] Template name
|
|
609
|
+
# Permanently delete a message template. **Without `language` this deletes every language variant of the name** (Meta's own contract for deletion by name). Pass `language` to delete one variant only; the response `scope` says which happened. Meta keeps a deleted approved template in `PENDING_DELETION` for a while and the name cannot be reused for 30 days.
|
|
610
|
+
# @param template_name [String] Template name (the family).
|
|
610
611
|
# @param account_id [String] WhatsApp social account ID
|
|
611
612
|
# @param [Hash] opts the optional parameters
|
|
612
|
-
# @
|
|
613
|
+
# @option opts [String] :language Delete only this language variant (e.g. es). Omit to delete the whole family.
|
|
614
|
+
# @return [Array<(DeleteWhatsAppTemplate200Response, Integer, Hash)>] DeleteWhatsAppTemplate200Response data, response status code and response headers
|
|
613
615
|
def delete_whats_app_template_with_http_info(template_name, account_id, opts = {})
|
|
614
616
|
if @api_client.config.debugging
|
|
615
617
|
@api_client.config.logger.debug 'Calling API: WhatsAppApi.delete_whats_app_template ...'
|
|
@@ -628,6 +630,7 @@ module Zernio
|
|
|
628
630
|
# query parameters
|
|
629
631
|
query_params = opts[:query_params] || {}
|
|
630
632
|
query_params[:'accountId'] = account_id
|
|
633
|
+
query_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
|
|
631
634
|
|
|
632
635
|
# header parameters
|
|
633
636
|
header_params = opts[:header_params] || {}
|
|
@@ -641,7 +644,7 @@ module Zernio
|
|
|
641
644
|
post_body = opts[:debug_body]
|
|
642
645
|
|
|
643
646
|
# return_type
|
|
644
|
-
return_type = opts[:debug_return_type] || '
|
|
647
|
+
return_type = opts[:debug_return_type] || 'DeleteWhatsAppTemplate200Response'
|
|
645
648
|
|
|
646
649
|
# auth_names
|
|
647
650
|
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
@@ -663,6 +666,76 @@ module Zernio
|
|
|
663
666
|
return data, status_code, headers
|
|
664
667
|
end
|
|
665
668
|
|
|
669
|
+
# Delete template by id
|
|
670
|
+
# Delete one language variant by its Meta id. Other languages of the same name are untouched. The name cannot be reused for 30 days once its last variant is deleted.
|
|
671
|
+
# @param template_id [String] Meta template id (numeric).
|
|
672
|
+
# @param account_id [String] WhatsApp social account ID
|
|
673
|
+
# @param [Hash] opts the optional parameters
|
|
674
|
+
# @return [DeleteWhatsAppTemplateById200Response]
|
|
675
|
+
def delete_whats_app_template_by_id(template_id, account_id, opts = {})
|
|
676
|
+
data, _status_code, _headers = delete_whats_app_template_by_id_with_http_info(template_id, account_id, opts)
|
|
677
|
+
data
|
|
678
|
+
end
|
|
679
|
+
|
|
680
|
+
# Delete template by id
|
|
681
|
+
# Delete one language variant by its Meta id. Other languages of the same name are untouched. The name cannot be reused for 30 days once its last variant is deleted.
|
|
682
|
+
# @param template_id [String] Meta template id (numeric).
|
|
683
|
+
# @param account_id [String] WhatsApp social account ID
|
|
684
|
+
# @param [Hash] opts the optional parameters
|
|
685
|
+
# @return [Array<(DeleteWhatsAppTemplateById200Response, Integer, Hash)>] DeleteWhatsAppTemplateById200Response data, response status code and response headers
|
|
686
|
+
def delete_whats_app_template_by_id_with_http_info(template_id, account_id, opts = {})
|
|
687
|
+
if @api_client.config.debugging
|
|
688
|
+
@api_client.config.logger.debug 'Calling API: WhatsAppApi.delete_whats_app_template_by_id ...'
|
|
689
|
+
end
|
|
690
|
+
# verify the required parameter 'template_id' is set
|
|
691
|
+
if @api_client.config.client_side_validation && template_id.nil?
|
|
692
|
+
fail ArgumentError, "Missing the required parameter 'template_id' when calling WhatsAppApi.delete_whats_app_template_by_id"
|
|
693
|
+
end
|
|
694
|
+
# verify the required parameter 'account_id' is set
|
|
695
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
696
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling WhatsAppApi.delete_whats_app_template_by_id"
|
|
697
|
+
end
|
|
698
|
+
# resource path
|
|
699
|
+
local_var_path = '/v1/whatsapp/templates/id/{templateId}'.sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s))
|
|
700
|
+
|
|
701
|
+
# query parameters
|
|
702
|
+
query_params = opts[:query_params] || {}
|
|
703
|
+
query_params[:'accountId'] = account_id
|
|
704
|
+
|
|
705
|
+
# header parameters
|
|
706
|
+
header_params = opts[:header_params] || {}
|
|
707
|
+
# HTTP header 'Accept' (if needed)
|
|
708
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
709
|
+
|
|
710
|
+
# form parameters
|
|
711
|
+
form_params = opts[:form_params] || {}
|
|
712
|
+
|
|
713
|
+
# http body (model)
|
|
714
|
+
post_body = opts[:debug_body]
|
|
715
|
+
|
|
716
|
+
# return_type
|
|
717
|
+
return_type = opts[:debug_return_type] || 'DeleteWhatsAppTemplateById200Response'
|
|
718
|
+
|
|
719
|
+
# auth_names
|
|
720
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
721
|
+
|
|
722
|
+
new_options = opts.merge(
|
|
723
|
+
:operation => :"WhatsAppApi.delete_whats_app_template_by_id",
|
|
724
|
+
:header_params => header_params,
|
|
725
|
+
:query_params => query_params,
|
|
726
|
+
:form_params => form_params,
|
|
727
|
+
:body => post_body,
|
|
728
|
+
:auth_names => auth_names,
|
|
729
|
+
:return_type => return_type
|
|
730
|
+
)
|
|
731
|
+
|
|
732
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
733
|
+
if @api_client.config.debugging
|
|
734
|
+
@api_client.config.logger.debug "API called: WhatsAppApi#delete_whats_app_template_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
735
|
+
end
|
|
736
|
+
return data, status_code, headers
|
|
737
|
+
end
|
|
738
|
+
|
|
666
739
|
# Delete business username
|
|
667
740
|
# Release the currently claimed WhatsApp Business username from the account. After deletion the username becomes available for other accounts to claim.
|
|
668
741
|
# @param delete_whatsapp_business_username_request [DeleteWhatsappBusinessUsernameRequest]
|
|
@@ -1213,10 +1286,11 @@ module Zernio
|
|
|
1213
1286
|
end
|
|
1214
1287
|
|
|
1215
1288
|
# Get template
|
|
1216
|
-
# Retrieve
|
|
1217
|
-
# @param template_name [String] Template name
|
|
1289
|
+
# Retrieve one message template variant by name. Meta stores one template per **name + language**, so a name identifies a family of variants, each with its own Meta id. Pass `language` to address one variant. Without it, a name with a single variant resolves to that variant; a name with several returns `409 ambiguous_template` with `details.languages`. A bare language (`es`) matches a single regional variant (`es_ES`); if the family has several regional variants for it, that is also a 409. A full code (`es_ES`) must match exactly. Variants in `PENDING_DELETION` are not part of the family.
|
|
1290
|
+
# @param template_name [String] Template name (the family).
|
|
1218
1291
|
# @param account_id [String] WhatsApp social account ID
|
|
1219
1292
|
# @param [Hash] opts the optional parameters
|
|
1293
|
+
# @option opts [String] :language Language code of the variant (e.g. en_US, es, pt_BR). Required when the family has several languages.
|
|
1220
1294
|
# @return [GetWhatsAppTemplate200Response]
|
|
1221
1295
|
def get_whats_app_template(template_name, account_id, opts = {})
|
|
1222
1296
|
data, _status_code, _headers = get_whats_app_template_with_http_info(template_name, account_id, opts)
|
|
@@ -1224,10 +1298,11 @@ module Zernio
|
|
|
1224
1298
|
end
|
|
1225
1299
|
|
|
1226
1300
|
# Get template
|
|
1227
|
-
# Retrieve
|
|
1228
|
-
# @param template_name [String] Template name
|
|
1301
|
+
# Retrieve one message template variant by name. Meta stores one template per **name + language**, so a name identifies a family of variants, each with its own Meta id. Pass `language` to address one variant. Without it, a name with a single variant resolves to that variant; a name with several returns `409 ambiguous_template` with `details.languages`. A bare language (`es`) matches a single regional variant (`es_ES`); if the family has several regional variants for it, that is also a 409. A full code (`es_ES`) must match exactly. Variants in `PENDING_DELETION` are not part of the family.
|
|
1302
|
+
# @param template_name [String] Template name (the family).
|
|
1229
1303
|
# @param account_id [String] WhatsApp social account ID
|
|
1230
1304
|
# @param [Hash] opts the optional parameters
|
|
1305
|
+
# @option opts [String] :language Language code of the variant (e.g. en_US, es, pt_BR). Required when the family has several languages.
|
|
1231
1306
|
# @return [Array<(GetWhatsAppTemplate200Response, Integer, Hash)>] GetWhatsAppTemplate200Response data, response status code and response headers
|
|
1232
1307
|
def get_whats_app_template_with_http_info(template_name, account_id, opts = {})
|
|
1233
1308
|
if @api_client.config.debugging
|
|
@@ -1247,6 +1322,7 @@ module Zernio
|
|
|
1247
1322
|
# query parameters
|
|
1248
1323
|
query_params = opts[:query_params] || {}
|
|
1249
1324
|
query_params[:'accountId'] = account_id
|
|
1325
|
+
query_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
|
|
1250
1326
|
|
|
1251
1327
|
# header parameters
|
|
1252
1328
|
header_params = opts[:header_params] || {}
|
|
@@ -1282,10 +1358,83 @@ module Zernio
|
|
|
1282
1358
|
return data, status_code, headers
|
|
1283
1359
|
end
|
|
1284
1360
|
|
|
1361
|
+
# Get template by id
|
|
1362
|
+
# Retrieve one template variant by its Meta id, the id every variant of a family has on its own and the one the `whatsapp.template.status_updated` webhook carries.
|
|
1363
|
+
# @param template_id [String] Meta template id (numeric).
|
|
1364
|
+
# @param account_id [String] WhatsApp social account ID
|
|
1365
|
+
# @param [Hash] opts the optional parameters
|
|
1366
|
+
# @return [GetWhatsAppTemplate200Response]
|
|
1367
|
+
def get_whats_app_template_by_id(template_id, account_id, opts = {})
|
|
1368
|
+
data, _status_code, _headers = get_whats_app_template_by_id_with_http_info(template_id, account_id, opts)
|
|
1369
|
+
data
|
|
1370
|
+
end
|
|
1371
|
+
|
|
1372
|
+
# Get template by id
|
|
1373
|
+
# Retrieve one template variant by its Meta id, the id every variant of a family has on its own and the one the `whatsapp.template.status_updated` webhook carries.
|
|
1374
|
+
# @param template_id [String] Meta template id (numeric).
|
|
1375
|
+
# @param account_id [String] WhatsApp social account ID
|
|
1376
|
+
# @param [Hash] opts the optional parameters
|
|
1377
|
+
# @return [Array<(GetWhatsAppTemplate200Response, Integer, Hash)>] GetWhatsAppTemplate200Response data, response status code and response headers
|
|
1378
|
+
def get_whats_app_template_by_id_with_http_info(template_id, account_id, opts = {})
|
|
1379
|
+
if @api_client.config.debugging
|
|
1380
|
+
@api_client.config.logger.debug 'Calling API: WhatsAppApi.get_whats_app_template_by_id ...'
|
|
1381
|
+
end
|
|
1382
|
+
# verify the required parameter 'template_id' is set
|
|
1383
|
+
if @api_client.config.client_side_validation && template_id.nil?
|
|
1384
|
+
fail ArgumentError, "Missing the required parameter 'template_id' when calling WhatsAppApi.get_whats_app_template_by_id"
|
|
1385
|
+
end
|
|
1386
|
+
# verify the required parameter 'account_id' is set
|
|
1387
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
1388
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling WhatsAppApi.get_whats_app_template_by_id"
|
|
1389
|
+
end
|
|
1390
|
+
# resource path
|
|
1391
|
+
local_var_path = '/v1/whatsapp/templates/id/{templateId}'.sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s))
|
|
1392
|
+
|
|
1393
|
+
# query parameters
|
|
1394
|
+
query_params = opts[:query_params] || {}
|
|
1395
|
+
query_params[:'accountId'] = account_id
|
|
1396
|
+
|
|
1397
|
+
# header parameters
|
|
1398
|
+
header_params = opts[:header_params] || {}
|
|
1399
|
+
# HTTP header 'Accept' (if needed)
|
|
1400
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1401
|
+
|
|
1402
|
+
# form parameters
|
|
1403
|
+
form_params = opts[:form_params] || {}
|
|
1404
|
+
|
|
1405
|
+
# http body (model)
|
|
1406
|
+
post_body = opts[:debug_body]
|
|
1407
|
+
|
|
1408
|
+
# return_type
|
|
1409
|
+
return_type = opts[:debug_return_type] || 'GetWhatsAppTemplate200Response'
|
|
1410
|
+
|
|
1411
|
+
# auth_names
|
|
1412
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
1413
|
+
|
|
1414
|
+
new_options = opts.merge(
|
|
1415
|
+
:operation => :"WhatsAppApi.get_whats_app_template_by_id",
|
|
1416
|
+
:header_params => header_params,
|
|
1417
|
+
:query_params => query_params,
|
|
1418
|
+
:form_params => form_params,
|
|
1419
|
+
:body => post_body,
|
|
1420
|
+
:auth_names => auth_names,
|
|
1421
|
+
:return_type => return_type
|
|
1422
|
+
)
|
|
1423
|
+
|
|
1424
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1425
|
+
if @api_client.config.debugging
|
|
1426
|
+
@api_client.config.logger.debug "API called: WhatsAppApi#get_whats_app_template_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1427
|
+
end
|
|
1428
|
+
return data, status_code, headers
|
|
1429
|
+
end
|
|
1430
|
+
|
|
1285
1431
|
# List templates
|
|
1286
|
-
# List
|
|
1432
|
+
# List message templates for the WhatsApp Business Account (WABA) associated with the given account. Templates are fetched directly from the WhatsApp Cloud API. One entry per **name + language**: a multi-language template appears once per language, each with its own Meta `id`.
|
|
1287
1433
|
# @param account_id [String] WhatsApp social account ID
|
|
1288
1434
|
# @param [Hash] opts the optional parameters
|
|
1435
|
+
# @option opts [String] :name Exact template name; returns every language variant of that family.
|
|
1436
|
+
# @option opts [String] :language Exact language code (e.g. en_US).
|
|
1437
|
+
# @option opts [String] :status
|
|
1289
1438
|
# @return [GetWhatsAppTemplates200Response]
|
|
1290
1439
|
def get_whats_app_templates(account_id, opts = {})
|
|
1291
1440
|
data, _status_code, _headers = get_whats_app_templates_with_http_info(account_id, opts)
|
|
@@ -1293,9 +1442,12 @@ module Zernio
|
|
|
1293
1442
|
end
|
|
1294
1443
|
|
|
1295
1444
|
# List templates
|
|
1296
|
-
# List
|
|
1445
|
+
# List message templates for the WhatsApp Business Account (WABA) associated with the given account. Templates are fetched directly from the WhatsApp Cloud API. One entry per **name + language**: a multi-language template appears once per language, each with its own Meta `id`.
|
|
1297
1446
|
# @param account_id [String] WhatsApp social account ID
|
|
1298
1447
|
# @param [Hash] opts the optional parameters
|
|
1448
|
+
# @option opts [String] :name Exact template name; returns every language variant of that family.
|
|
1449
|
+
# @option opts [String] :language Exact language code (e.g. en_US).
|
|
1450
|
+
# @option opts [String] :status
|
|
1299
1451
|
# @return [Array<(GetWhatsAppTemplates200Response, Integer, Hash)>] GetWhatsAppTemplates200Response data, response status code and response headers
|
|
1300
1452
|
def get_whats_app_templates_with_http_info(account_id, opts = {})
|
|
1301
1453
|
if @api_client.config.debugging
|
|
@@ -1305,12 +1457,19 @@ module Zernio
|
|
|
1305
1457
|
if @api_client.config.client_side_validation && account_id.nil?
|
|
1306
1458
|
fail ArgumentError, "Missing the required parameter 'account_id' when calling WhatsAppApi.get_whats_app_templates"
|
|
1307
1459
|
end
|
|
1460
|
+
allowable_values = ["APPROVED", "REJECTED", "PENDING", "PAUSED", "DISABLED", "IN_APPEAL", "PENDING_DELETION"]
|
|
1461
|
+
if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
|
|
1462
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
|
|
1463
|
+
end
|
|
1308
1464
|
# resource path
|
|
1309
1465
|
local_var_path = '/v1/whatsapp/templates'
|
|
1310
1466
|
|
|
1311
1467
|
# query parameters
|
|
1312
1468
|
query_params = opts[:query_params] || {}
|
|
1313
1469
|
query_params[:'accountId'] = account_id
|
|
1470
|
+
query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
|
|
1471
|
+
query_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
|
|
1472
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
|
1314
1473
|
|
|
1315
1474
|
# header parameters
|
|
1316
1475
|
header_params = opts[:header_params] || {}
|
|
@@ -2422,8 +2581,8 @@ module Zernio
|
|
|
2422
2581
|
end
|
|
2423
2582
|
|
|
2424
2583
|
# Update template
|
|
2425
|
-
# Update
|
|
2426
|
-
# @param template_name [String] Template name
|
|
2584
|
+
# Update one variant's components. Name, language and category cannot change after creation. Meta stores one template per **name + language**, so a name identifies a family of variants, each with its own Meta id. Pass `language` to address one variant. Without it, a name with a single variant resolves to that variant; a name with several returns `409 ambiguous_template` with `details.languages`. A bare language (`es`) matches a single regional variant (`es_ES`); if the family has several regional variants for it, that is also a 409. A full code (`es_ES`) must match exactly. Variants in `PENDING_DELETION` are not part of the family. Meta only allows editing templates in `APPROVED`, `REJECTED` or `PAUSED` state; an approved template can be edited once per 24 hours and up to 10 times per 30 days. A successful update sends the variant back to Meta for review, so the `status` returned here is normally `PENDING`. The final outcome arrives on the `whatsapp.template.status_updated` webhook (which carries the variant's `templateId` and `language`). A variant already in `PENDING` cannot be edited again until Meta finishes reviewing it.
|
|
2585
|
+
# @param template_name [String] Template name (the family).
|
|
2427
2586
|
# @param update_whats_app_template_request [UpdateWhatsAppTemplateRequest]
|
|
2428
2587
|
# @param [Hash] opts the optional parameters
|
|
2429
2588
|
# @return [UpdateWhatsAppTemplate200Response]
|
|
@@ -2433,8 +2592,8 @@ module Zernio
|
|
|
2433
2592
|
end
|
|
2434
2593
|
|
|
2435
2594
|
# Update template
|
|
2436
|
-
# Update
|
|
2437
|
-
# @param template_name [String] Template name
|
|
2595
|
+
# Update one variant's components. Name, language and category cannot change after creation. Meta stores one template per **name + language**, so a name identifies a family of variants, each with its own Meta id. Pass `language` to address one variant. Without it, a name with a single variant resolves to that variant; a name with several returns `409 ambiguous_template` with `details.languages`. A bare language (`es`) matches a single regional variant (`es_ES`); if the family has several regional variants for it, that is also a 409. A full code (`es_ES`) must match exactly. Variants in `PENDING_DELETION` are not part of the family. Meta only allows editing templates in `APPROVED`, `REJECTED` or `PAUSED` state; an approved template can be edited once per 24 hours and up to 10 times per 30 days. A successful update sends the variant back to Meta for review, so the `status` returned here is normally `PENDING`. The final outcome arrives on the `whatsapp.template.status_updated` webhook (which carries the variant's `templateId` and `language`). A variant already in `PENDING` cannot be edited again until Meta finishes reviewing it.
|
|
2596
|
+
# @param template_name [String] Template name (the family).
|
|
2438
2597
|
# @param update_whats_app_template_request [UpdateWhatsAppTemplateRequest]
|
|
2439
2598
|
# @param [Hash] opts the optional parameters
|
|
2440
2599
|
# @return [Array<(UpdateWhatsAppTemplate200Response, Integer, Hash)>] UpdateWhatsAppTemplate200Response data, response status code and response headers
|
|
@@ -2495,6 +2654,80 @@ module Zernio
|
|
|
2495
2654
|
return data, status_code, headers
|
|
2496
2655
|
end
|
|
2497
2656
|
|
|
2657
|
+
# Update template by id
|
|
2658
|
+
# Update one variant's components by its Meta id. Name, language and category cannot change. Meta only allows editing templates in `APPROVED`, `REJECTED` or `PAUSED` state; an approved template can be edited once per 24 hours and up to 10 times per 30 days. A successful update sends the variant back to Meta for review, so the `status` returned here is normally `PENDING`. The final outcome arrives on the `whatsapp.template.status_updated` webhook (which carries the variant's `templateId` and `language`). A variant already in `PENDING` cannot be edited again until Meta finishes reviewing it.
|
|
2659
|
+
# @param template_id [String] Meta template id (numeric).
|
|
2660
|
+
# @param update_whats_app_template_by_id_request [UpdateWhatsAppTemplateByIdRequest]
|
|
2661
|
+
# @param [Hash] opts the optional parameters
|
|
2662
|
+
# @return [UpdateWhatsAppTemplateById200Response]
|
|
2663
|
+
def update_whats_app_template_by_id(template_id, update_whats_app_template_by_id_request, opts = {})
|
|
2664
|
+
data, _status_code, _headers = update_whats_app_template_by_id_with_http_info(template_id, update_whats_app_template_by_id_request, opts)
|
|
2665
|
+
data
|
|
2666
|
+
end
|
|
2667
|
+
|
|
2668
|
+
# Update template by id
|
|
2669
|
+
# Update one variant's components by its Meta id. Name, language and category cannot change. Meta only allows editing templates in `APPROVED`, `REJECTED` or `PAUSED` state; an approved template can be edited once per 24 hours and up to 10 times per 30 days. A successful update sends the variant back to Meta for review, so the `status` returned here is normally `PENDING`. The final outcome arrives on the `whatsapp.template.status_updated` webhook (which carries the variant's `templateId` and `language`). A variant already in `PENDING` cannot be edited again until Meta finishes reviewing it.
|
|
2670
|
+
# @param template_id [String] Meta template id (numeric).
|
|
2671
|
+
# @param update_whats_app_template_by_id_request [UpdateWhatsAppTemplateByIdRequest]
|
|
2672
|
+
# @param [Hash] opts the optional parameters
|
|
2673
|
+
# @return [Array<(UpdateWhatsAppTemplateById200Response, Integer, Hash)>] UpdateWhatsAppTemplateById200Response data, response status code and response headers
|
|
2674
|
+
def update_whats_app_template_by_id_with_http_info(template_id, update_whats_app_template_by_id_request, opts = {})
|
|
2675
|
+
if @api_client.config.debugging
|
|
2676
|
+
@api_client.config.logger.debug 'Calling API: WhatsAppApi.update_whats_app_template_by_id ...'
|
|
2677
|
+
end
|
|
2678
|
+
# verify the required parameter 'template_id' is set
|
|
2679
|
+
if @api_client.config.client_side_validation && template_id.nil?
|
|
2680
|
+
fail ArgumentError, "Missing the required parameter 'template_id' when calling WhatsAppApi.update_whats_app_template_by_id"
|
|
2681
|
+
end
|
|
2682
|
+
# verify the required parameter 'update_whats_app_template_by_id_request' is set
|
|
2683
|
+
if @api_client.config.client_side_validation && update_whats_app_template_by_id_request.nil?
|
|
2684
|
+
fail ArgumentError, "Missing the required parameter 'update_whats_app_template_by_id_request' when calling WhatsAppApi.update_whats_app_template_by_id"
|
|
2685
|
+
end
|
|
2686
|
+
# resource path
|
|
2687
|
+
local_var_path = '/v1/whatsapp/templates/id/{templateId}'.sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s))
|
|
2688
|
+
|
|
2689
|
+
# query parameters
|
|
2690
|
+
query_params = opts[:query_params] || {}
|
|
2691
|
+
|
|
2692
|
+
# header parameters
|
|
2693
|
+
header_params = opts[:header_params] || {}
|
|
2694
|
+
# HTTP header 'Accept' (if needed)
|
|
2695
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
2696
|
+
# HTTP header 'Content-Type'
|
|
2697
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
2698
|
+
if !content_type.nil?
|
|
2699
|
+
header_params['Content-Type'] = content_type
|
|
2700
|
+
end
|
|
2701
|
+
|
|
2702
|
+
# form parameters
|
|
2703
|
+
form_params = opts[:form_params] || {}
|
|
2704
|
+
|
|
2705
|
+
# http body (model)
|
|
2706
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_whats_app_template_by_id_request)
|
|
2707
|
+
|
|
2708
|
+
# return_type
|
|
2709
|
+
return_type = opts[:debug_return_type] || 'UpdateWhatsAppTemplateById200Response'
|
|
2710
|
+
|
|
2711
|
+
# auth_names
|
|
2712
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
2713
|
+
|
|
2714
|
+
new_options = opts.merge(
|
|
2715
|
+
:operation => :"WhatsAppApi.update_whats_app_template_by_id",
|
|
2716
|
+
:header_params => header_params,
|
|
2717
|
+
:query_params => query_params,
|
|
2718
|
+
:form_params => form_params,
|
|
2719
|
+
:body => post_body,
|
|
2720
|
+
:auth_names => auth_names,
|
|
2721
|
+
:return_type => return_type
|
|
2722
|
+
)
|
|
2723
|
+
|
|
2724
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
2725
|
+
if @api_client.config.debugging
|
|
2726
|
+
@api_client.config.logger.debug "API called: WhatsAppApi#update_whats_app_template_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2727
|
+
end
|
|
2728
|
+
return data, status_code, headers
|
|
2729
|
+
end
|
|
2730
|
+
|
|
2498
2731
|
# Upload profile picture
|
|
2499
2732
|
# Upload a new profile picture for the WhatsApp Business Profile. Uses Meta's resumable upload API under the hood: creates an upload session, uploads the image bytes, then updates the business profile with the resulting handle. Provide the image either as a binary upload (`multipart/form-data` with `file`) or as a download URL (`application/json` with `url`) — with a URL we fetch the image server-side and upload the bytes for you. Meta's profile-photo API is bytes-only, so there is no direct URL passthrough. JPEG/PNG, max 5MB either way.
|
|
2500
2733
|
# @param account_id [String] WhatsApp social account ID
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Zernio
|
|
17
|
+
class DeleteWhatsAppTemplate200Response < ApiModelBase
|
|
18
|
+
attr_accessor :success
|
|
19
|
+
|
|
20
|
+
# Whether the whole family or one variant was deleted.
|
|
21
|
+
attr_accessor :scope
|
|
22
|
+
|
|
23
|
+
# The deleted variant; only when scope is language.
|
|
24
|
+
attr_accessor :language
|
|
25
|
+
|
|
26
|
+
attr_accessor :message
|
|
27
|
+
|
|
28
|
+
class EnumAttributeValidator
|
|
29
|
+
attr_reader :datatype
|
|
30
|
+
attr_reader :allowable_values
|
|
31
|
+
|
|
32
|
+
def initialize(datatype, allowable_values)
|
|
33
|
+
@allowable_values = allowable_values.map do |value|
|
|
34
|
+
case datatype.to_s
|
|
35
|
+
when /Integer/i
|
|
36
|
+
value.to_i
|
|
37
|
+
when /Float/i
|
|
38
|
+
value.to_f
|
|
39
|
+
else
|
|
40
|
+
value
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def valid?(value)
|
|
46
|
+
!value || allowable_values.include?(value)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
51
|
+
def self.attribute_map
|
|
52
|
+
{
|
|
53
|
+
:'success' => :'success',
|
|
54
|
+
:'scope' => :'scope',
|
|
55
|
+
:'language' => :'language',
|
|
56
|
+
:'message' => :'message'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Returns attribute mapping this model knows about
|
|
61
|
+
def self.acceptable_attribute_map
|
|
62
|
+
attribute_map
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Returns all the JSON keys this model knows about
|
|
66
|
+
def self.acceptable_attributes
|
|
67
|
+
acceptable_attribute_map.values
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Attribute type mapping.
|
|
71
|
+
def self.openapi_types
|
|
72
|
+
{
|
|
73
|
+
:'success' => :'Boolean',
|
|
74
|
+
:'scope' => :'String',
|
|
75
|
+
:'language' => :'String',
|
|
76
|
+
:'message' => :'String'
|
|
77
|
+
}
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# List of attributes with nullable: true
|
|
81
|
+
def self.openapi_nullable
|
|
82
|
+
Set.new([
|
|
83
|
+
])
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Initializes the object
|
|
87
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
88
|
+
def initialize(attributes = {})
|
|
89
|
+
if (!attributes.is_a?(Hash))
|
|
90
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::DeleteWhatsAppTemplate200Response` initialize method"
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
94
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
95
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
96
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
97
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::DeleteWhatsAppTemplate200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
98
|
+
end
|
|
99
|
+
h[k.to_sym] = v
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'success')
|
|
103
|
+
self.success = attributes[:'success']
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if attributes.key?(:'scope')
|
|
107
|
+
self.scope = attributes[:'scope']
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if attributes.key?(:'language')
|
|
111
|
+
self.language = attributes[:'language']
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'message')
|
|
115
|
+
self.message = attributes[:'message']
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
120
|
+
# @return Array for valid properties with the reasons
|
|
121
|
+
def list_invalid_properties
|
|
122
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
123
|
+
invalid_properties = Array.new
|
|
124
|
+
invalid_properties
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Check to see if the all the properties in the model are valid
|
|
128
|
+
# @return true if the model is valid
|
|
129
|
+
def valid?
|
|
130
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
131
|
+
scope_validator = EnumAttributeValidator.new('String', ["all_languages", "language"])
|
|
132
|
+
return false unless scope_validator.valid?(@scope)
|
|
133
|
+
true
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
137
|
+
# @param [Object] scope Object to be assigned
|
|
138
|
+
def scope=(scope)
|
|
139
|
+
validator = EnumAttributeValidator.new('String', ["all_languages", "language"])
|
|
140
|
+
unless validator.valid?(scope)
|
|
141
|
+
fail ArgumentError, "invalid value for \"scope\", must be one of #{validator.allowable_values}."
|
|
142
|
+
end
|
|
143
|
+
@scope = scope
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Checks equality by comparing each attribute.
|
|
147
|
+
# @param [Object] Object to be compared
|
|
148
|
+
def ==(o)
|
|
149
|
+
return true if self.equal?(o)
|
|
150
|
+
self.class == o.class &&
|
|
151
|
+
success == o.success &&
|
|
152
|
+
scope == o.scope &&
|
|
153
|
+
language == o.language &&
|
|
154
|
+
message == o.message
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# @see the `==` method
|
|
158
|
+
# @param [Object] Object to be compared
|
|
159
|
+
def eql?(o)
|
|
160
|
+
self == o
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Calculates hash code according to all attributes.
|
|
164
|
+
# @return [Integer] Hash code
|
|
165
|
+
def hash
|
|
166
|
+
[success, scope, language, message].hash
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Builds the object from hash
|
|
170
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
171
|
+
# @return [Object] Returns the model itself
|
|
172
|
+
def self.build_from_hash(attributes)
|
|
173
|
+
return nil unless attributes.is_a?(Hash)
|
|
174
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
175
|
+
transformed_hash = {}
|
|
176
|
+
openapi_types.each_pair do |key, type|
|
|
177
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
178
|
+
transformed_hash["#{key}"] = nil
|
|
179
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
180
|
+
# check to ensure the input is an array given that the attribute
|
|
181
|
+
# is documented as an array but the input is not
|
|
182
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
183
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
184
|
+
end
|
|
185
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
186
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
187
|
+
end
|
|
188
|
+
end
|
|
189
|
+
new(transformed_hash)
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Returns the object in the form of hash
|
|
193
|
+
# @return [Hash] Returns the object in the form of hash
|
|
194
|
+
def to_hash
|
|
195
|
+
hash = {}
|
|
196
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
197
|
+
value = self.send(attr)
|
|
198
|
+
if value.nil?
|
|
199
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
200
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
hash[param] = _to_hash(value)
|
|
204
|
+
end
|
|
205
|
+
hash
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
end
|