zernio-sdk 0.0.827 → 0.0.828

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b58144b3f772896b868e6c6f764729caf6ac0f8eff8f03bbd0a906f607ce83f
4
- data.tar.gz: 4d9aa39a326bf2cb9f0c04288d8dfadde26863a00763ea41039ce7f6639212b7
3
+ metadata.gz: a899ee77a7c1f7602ebdf10a4fb81acee764ccef52e2737aece1eba1d9a6aaf6
4
+ data.tar.gz: 4df99f1c4be40c35a83545c0effb6db9a03d447d33592884fc9601f4ead4a852
5
5
  SHA512:
6
- metadata.gz: 2af8170bbcafc79dd5837950eadaba68491eaf6ceb22351771f478b95af51592456aa07a96a99b023a06d0cdcc7e5c2408016dfe82735a449f474f555ab07af6
7
- data.tar.gz: 0c73bdd561e5db4622402d2d10836a64924767fb96d114ff80fabad27679406e41d847e526494f87401ed0724f09c044f56929c580872e2b0cd2e9703da8ee89
6
+ metadata.gz: 0e84260ac6503cb4e60ec9f2977508b973f9203ffd21cbb9fc5555119deaf11817a0027e41f2d5bb129cc799d7c1db25b6fc973764e5377f51c92e49e36cc2bf
7
+ data.tar.gz: b7fc5feaaef38a44e9590de8eff38a0ad9c776ea2e79ec9c96f6e8bdbd9fc5e9c5b27701d140e1b9b7520d8a3f0c1054127895e4d49ac61e9b29f3c63c805aaf
data/README.md CHANGED
@@ -633,11 +633,13 @@ Class | Method | HTTP request | Description
633
633
  *Zernio::WhatsAppFlowsApi* | [**get_whats_app_flow**](docs/WhatsAppFlowsApi.md#get_whats_app_flow) | **GET** /v1/whatsapp/flows/{flowId} | Get flow
634
634
  *Zernio::WhatsAppFlowsApi* | [**get_whats_app_flow_json**](docs/WhatsAppFlowsApi.md#get_whats_app_flow_json) | **GET** /v1/whatsapp/flows/{flowId}/json | Get flow JSON asset
635
635
  *Zernio::WhatsAppFlowsApi* | [**get_whats_app_flow_preview**](docs/WhatsAppFlowsApi.md#get_whats_app_flow_preview) | **GET** /v1/whatsapp/flows/{flowId}/preview | Get flow preview URL
636
+ *Zernio::WhatsAppFlowsApi* | [**get_whats_app_flows_encryption_key**](docs/WhatsAppFlowsApi.md#get_whats_app_flows_encryption_key) | **GET** /v1/whatsapp/flows/encryption-key | Get Flows encryption key status
636
637
  *Zernio::WhatsAppFlowsApi* | [**list_whats_app_flow_responses**](docs/WhatsAppFlowsApi.md#list_whats_app_flow_responses) | **GET** /v1/whatsapp/flow-responses | List flow responses
637
638
  *Zernio::WhatsAppFlowsApi* | [**list_whats_app_flow_versions**](docs/WhatsAppFlowsApi.md#list_whats_app_flow_versions) | **GET** /v1/whatsapp/flows/{flowId}/versions | List flow versions
638
639
  *Zernio::WhatsAppFlowsApi* | [**list_whats_app_flows**](docs/WhatsAppFlowsApi.md#list_whats_app_flows) | **GET** /v1/whatsapp/flows | List flows
639
640
  *Zernio::WhatsAppFlowsApi* | [**publish_whats_app_flow**](docs/WhatsAppFlowsApi.md#publish_whats_app_flow) | **POST** /v1/whatsapp/flows/{flowId}/publish | Publish flow
640
641
  *Zernio::WhatsAppFlowsApi* | [**send_whats_app_flow_message**](docs/WhatsAppFlowsApi.md#send_whats_app_flow_message) | **POST** /v1/whatsapp/flows/send | Send flow message
642
+ *Zernio::WhatsAppFlowsApi* | [**set_whats_app_flows_encryption_key**](docs/WhatsAppFlowsApi.md#set_whats_app_flows_encryption_key) | **POST** /v1/whatsapp/flows/encryption-key | Register a Flows encryption key
641
643
  *Zernio::WhatsAppFlowsApi* | [**update_whats_app_flow**](docs/WhatsAppFlowsApi.md#update_whats_app_flow) | **PATCH** /v1/whatsapp/flows/{flowId} | Update flow
642
644
  *Zernio::WhatsAppFlowsApi* | [**upload_whats_app_flow_json**](docs/WhatsAppFlowsApi.md#upload_whats_app_flow_json) | **PUT** /v1/whatsapp/flows/{flowId}/json | Upload flow JSON
643
645
  *Zernio::WhatsAppPhoneNumbersApi* | [**check_whats_app_number_availability**](docs/WhatsAppPhoneNumbersApi.md#check_whats_app_number_availability) | **GET** /v1/whatsapp/phone-numbers/availability | Check country availability
@@ -1444,6 +1446,7 @@ Class | Method | HTTP request | Description
1444
1446
  - [Zernio::GetWhatsAppFlowJson200Response](docs/GetWhatsAppFlowJson200Response.md)
1445
1447
  - [Zernio::GetWhatsAppFlowJson200ResponseAssetsInner](docs/GetWhatsAppFlowJson200ResponseAssetsInner.md)
1446
1448
  - [Zernio::GetWhatsAppFlowPreview200Response](docs/GetWhatsAppFlowPreview200Response.md)
1449
+ - [Zernio::GetWhatsAppFlowsEncryptionKey200Response](docs/GetWhatsAppFlowsEncryptionKey200Response.md)
1447
1450
  - [Zernio::GetWhatsAppGroupChat200Response](docs/GetWhatsAppGroupChat200Response.md)
1448
1451
  - [Zernio::GetWhatsAppGroupChat200ResponseGroup](docs/GetWhatsAppGroupChat200ResponseGroup.md)
1449
1452
  - [Zernio::GetWhatsAppGroupChat200ResponseGroupParticipantsInner](docs/GetWhatsAppGroupChat200ResponseGroupParticipantsInner.md)
@@ -2020,6 +2023,7 @@ Class | Method | HTTP request | Description
2020
2023
  - [Zernio::SetRedditPostFlairRequest](docs/SetRedditPostFlairRequest.md)
2021
2024
  - [Zernio::SetTelegramCommandsRequest](docs/SetTelegramCommandsRequest.md)
2022
2025
  - [Zernio::SetTelegramCommandsRequestCommandsInner](docs/SetTelegramCommandsRequestCommandsInner.md)
2026
+ - [Zernio::SetWhatsAppFlowsEncryptionKeyRequest](docs/SetWhatsAppFlowsEncryptionKeyRequest.md)
2023
2027
  - [Zernio::SetWhatsappBusinessUsername200Response](docs/SetWhatsappBusinessUsername200Response.md)
2024
2028
  - [Zernio::SetWhatsappBusinessUsernameRequest](docs/SetWhatsappBusinessUsernameRequest.md)
2025
2029
  - [Zernio::ShareSmsRegistration200Response](docs/ShareSmsRegistration200Response.md)
@@ -0,0 +1,22 @@
1
+ # Zernio::GetWhatsAppFlowsEncryptionKey200Response
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **public_key** | **String** | The registered RSA public key in PEM format, or null when none is registered. | [optional] |
8
+ | **signature_status** | **String** | VALID (key matches Meta's records) or MISMATCH (no key registered, or the key does not match); null when unknown. | [optional] |
9
+ | **registered** | **Boolean** | Whether a key is currently registered. Derived from publicKey, not signatureStatus. | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'zernio-sdk'
15
+
16
+ instance = Zernio::GetWhatsAppFlowsEncryptionKey200Response.new(
17
+ public_key: null,
18
+ signature_status: null,
19
+ registered: null
20
+ )
21
+ ```
22
+
@@ -0,0 +1,20 @@
1
+ # Zernio::SetWhatsAppFlowsEncryptionKeyRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **account_id** | **String** | WhatsApp social account ID | |
8
+ | **business_public_key** | **String** | RSA public key in PEM format. Rejected if it is a private key or not a valid RSA public key PEM. | |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'zernio-sdk'
14
+
15
+ instance = Zernio::SetWhatsAppFlowsEncryptionKeyRequest.new(
16
+ account_id: null,
17
+ business_public_key: null
18
+ )
19
+ ```
20
+
@@ -10,11 +10,13 @@ All URIs are relative to *https://zernio.com/api*
10
10
  | [**get_whats_app_flow**](WhatsAppFlowsApi.md#get_whats_app_flow) | **GET** /v1/whatsapp/flows/{flowId} | Get flow |
11
11
  | [**get_whats_app_flow_json**](WhatsAppFlowsApi.md#get_whats_app_flow_json) | **GET** /v1/whatsapp/flows/{flowId}/json | Get flow JSON asset |
12
12
  | [**get_whats_app_flow_preview**](WhatsAppFlowsApi.md#get_whats_app_flow_preview) | **GET** /v1/whatsapp/flows/{flowId}/preview | Get flow preview URL |
13
+ | [**get_whats_app_flows_encryption_key**](WhatsAppFlowsApi.md#get_whats_app_flows_encryption_key) | **GET** /v1/whatsapp/flows/encryption-key | Get Flows encryption key status |
13
14
  | [**list_whats_app_flow_responses**](WhatsAppFlowsApi.md#list_whats_app_flow_responses) | **GET** /v1/whatsapp/flow-responses | List flow responses |
14
15
  | [**list_whats_app_flow_versions**](WhatsAppFlowsApi.md#list_whats_app_flow_versions) | **GET** /v1/whatsapp/flows/{flowId}/versions | List flow versions |
15
16
  | [**list_whats_app_flows**](WhatsAppFlowsApi.md#list_whats_app_flows) | **GET** /v1/whatsapp/flows | List flows |
16
17
  | [**publish_whats_app_flow**](WhatsAppFlowsApi.md#publish_whats_app_flow) | **POST** /v1/whatsapp/flows/{flowId}/publish | Publish flow |
17
18
  | [**send_whats_app_flow_message**](WhatsAppFlowsApi.md#send_whats_app_flow_message) | **POST** /v1/whatsapp/flows/send | Send flow message |
19
+ | [**set_whats_app_flows_encryption_key**](WhatsAppFlowsApi.md#set_whats_app_flows_encryption_key) | **POST** /v1/whatsapp/flows/encryption-key | Register a Flows encryption key |
18
20
  | [**update_whats_app_flow**](WhatsAppFlowsApi.md#update_whats_app_flow) | **PATCH** /v1/whatsapp/flows/{flowId} | Update flow |
19
21
  | [**upload_whats_app_flow_json**](WhatsAppFlowsApi.md#upload_whats_app_flow_json) | **PUT** /v1/whatsapp/flows/{flowId}/json | Upload flow JSON |
20
22
 
@@ -451,6 +453,75 @@ end
451
453
  - **Accept**: application/json
452
454
 
453
455
 
456
+ ## get_whats_app_flows_encryption_key
457
+
458
+ > <GetWhatsAppFlowsEncryptionKey200Response> get_whats_app_flows_encryption_key(account_id)
459
+
460
+ Get Flows encryption key status
461
+
462
+ Read the RSA business public key registered on the phone number for WhatsApp Flows endpoint encryption. Only one key is active per phone number at a time. Flows that use flow_action: data_exchange (an endpoint-backed flow) stop working at runtime until the endpoint serves the matching private key, and Meta rejects publish with error code 139002 (\"Missing Flows Signed Public Key\") when no key is registered. `registered` reflects whether a key is present, never `signatureStatus` alone: Meta reports an unregistered key as MISMATCH rather than a null/absent value.
463
+
464
+ ### Examples
465
+
466
+ ```ruby
467
+ require 'time'
468
+ require 'zernio-sdk'
469
+ # setup authorization
470
+ Zernio.configure do |config|
471
+ # Configure Bearer authorization (JWT): bearerAuth
472
+ config.access_token = 'YOUR_BEARER_TOKEN'
473
+ end
474
+
475
+ api_instance = Zernio::WhatsAppFlowsApi.new
476
+ account_id = 'account_id_example' # String | WhatsApp social account ID
477
+
478
+ begin
479
+ # Get Flows encryption key status
480
+ result = api_instance.get_whats_app_flows_encryption_key(account_id)
481
+ p result
482
+ rescue Zernio::ApiError => e
483
+ puts "Error when calling WhatsAppFlowsApi->get_whats_app_flows_encryption_key: #{e}"
484
+ end
485
+ ```
486
+
487
+ #### Using the get_whats_app_flows_encryption_key_with_http_info variant
488
+
489
+ This returns an Array which contains the response data, status code and headers.
490
+
491
+ > <Array(<GetWhatsAppFlowsEncryptionKey200Response>, Integer, Hash)> get_whats_app_flows_encryption_key_with_http_info(account_id)
492
+
493
+ ```ruby
494
+ begin
495
+ # Get Flows encryption key status
496
+ data, status_code, headers = api_instance.get_whats_app_flows_encryption_key_with_http_info(account_id)
497
+ p status_code # => 2xx
498
+ p headers # => { ... }
499
+ p data # => <GetWhatsAppFlowsEncryptionKey200Response>
500
+ rescue Zernio::ApiError => e
501
+ puts "Error when calling WhatsAppFlowsApi->get_whats_app_flows_encryption_key_with_http_info: #{e}"
502
+ end
503
+ ```
504
+
505
+ ### Parameters
506
+
507
+ | Name | Type | Description | Notes |
508
+ | ---- | ---- | ----------- | ----- |
509
+ | **account_id** | **String** | WhatsApp social account ID | |
510
+
511
+ ### Return type
512
+
513
+ [**GetWhatsAppFlowsEncryptionKey200Response**](GetWhatsAppFlowsEncryptionKey200Response.md)
514
+
515
+ ### Authorization
516
+
517
+ [bearerAuth](../README.md#bearerAuth)
518
+
519
+ ### HTTP request headers
520
+
521
+ - **Content-Type**: Not defined
522
+ - **Accept**: application/json
523
+
524
+
454
525
  ## list_whats_app_flow_responses
455
526
 
456
527
  > <ListWhatsAppFlowResponses200Response> list_whats_app_flow_responses(account_id, opts)
@@ -806,6 +877,75 @@ end
806
877
  - **Accept**: application/json
807
878
 
808
879
 
880
+ ## set_whats_app_flows_encryption_key
881
+
882
+ > <UpdateYoutubeDefaultPlaylist200Response> set_whats_app_flows_encryption_key(set_whats_app_flows_encryption_key_request)
883
+
884
+ Register a Flows encryption key
885
+
886
+ Register (or replace) the RSA business public key for WhatsApp Flows endpoint encryption on the phone number. Uploading a new key replaces the previous one: only one key is active per phone number. The corresponding private key must be served by the flow's endpoint, or endpoint-backed flows (flow_action: data_exchange) will fail at runtime even though the key is registered.
887
+
888
+ ### Examples
889
+
890
+ ```ruby
891
+ require 'time'
892
+ require 'zernio-sdk'
893
+ # setup authorization
894
+ Zernio.configure do |config|
895
+ # Configure Bearer authorization (JWT): bearerAuth
896
+ config.access_token = 'YOUR_BEARER_TOKEN'
897
+ end
898
+
899
+ api_instance = Zernio::WhatsAppFlowsApi.new
900
+ set_whats_app_flows_encryption_key_request = Zernio::SetWhatsAppFlowsEncryptionKeyRequest.new({account_id: 'account_id_example', business_public_key: 'business_public_key_example'}) # SetWhatsAppFlowsEncryptionKeyRequest |
901
+
902
+ begin
903
+ # Register a Flows encryption key
904
+ result = api_instance.set_whats_app_flows_encryption_key(set_whats_app_flows_encryption_key_request)
905
+ p result
906
+ rescue Zernio::ApiError => e
907
+ puts "Error when calling WhatsAppFlowsApi->set_whats_app_flows_encryption_key: #{e}"
908
+ end
909
+ ```
910
+
911
+ #### Using the set_whats_app_flows_encryption_key_with_http_info variant
912
+
913
+ This returns an Array which contains the response data, status code and headers.
914
+
915
+ > <Array(<UpdateYoutubeDefaultPlaylist200Response>, Integer, Hash)> set_whats_app_flows_encryption_key_with_http_info(set_whats_app_flows_encryption_key_request)
916
+
917
+ ```ruby
918
+ begin
919
+ # Register a Flows encryption key
920
+ data, status_code, headers = api_instance.set_whats_app_flows_encryption_key_with_http_info(set_whats_app_flows_encryption_key_request)
921
+ p status_code # => 2xx
922
+ p headers # => { ... }
923
+ p data # => <UpdateYoutubeDefaultPlaylist200Response>
924
+ rescue Zernio::ApiError => e
925
+ puts "Error when calling WhatsAppFlowsApi->set_whats_app_flows_encryption_key_with_http_info: #{e}"
926
+ end
927
+ ```
928
+
929
+ ### Parameters
930
+
931
+ | Name | Type | Description | Notes |
932
+ | ---- | ---- | ----------- | ----- |
933
+ | **set_whats_app_flows_encryption_key_request** | [**SetWhatsAppFlowsEncryptionKeyRequest**](SetWhatsAppFlowsEncryptionKeyRequest.md) | | |
934
+
935
+ ### Return type
936
+
937
+ [**UpdateYoutubeDefaultPlaylist200Response**](UpdateYoutubeDefaultPlaylist200Response.md)
938
+
939
+ ### Authorization
940
+
941
+ [bearerAuth](../README.md#bearerAuth)
942
+
943
+ ### HTTP request headers
944
+
945
+ - **Content-Type**: application/json
946
+ - **Accept**: application/json
947
+
948
+
809
949
  ## update_whats_app_flow
810
950
 
811
951
  > <UpdateYoutubeDefaultPlaylist200Response> update_whats_app_flow(flow_id, update_whats_app_flow_request)
@@ -447,6 +447,70 @@ module Zernio
447
447
  return data, status_code, headers
448
448
  end
449
449
 
450
+ # Get Flows encryption key status
451
+ # Read the RSA business public key registered on the phone number for WhatsApp Flows endpoint encryption. Only one key is active per phone number at a time. Flows that use flow_action: data_exchange (an endpoint-backed flow) stop working at runtime until the endpoint serves the matching private key, and Meta rejects publish with error code 139002 (\"Missing Flows Signed Public Key\") when no key is registered. `registered` reflects whether a key is present, never `signatureStatus` alone: Meta reports an unregistered key as MISMATCH rather than a null/absent value.
452
+ # @param account_id [String] WhatsApp social account ID
453
+ # @param [Hash] opts the optional parameters
454
+ # @return [GetWhatsAppFlowsEncryptionKey200Response]
455
+ def get_whats_app_flows_encryption_key(account_id, opts = {})
456
+ data, _status_code, _headers = get_whats_app_flows_encryption_key_with_http_info(account_id, opts)
457
+ data
458
+ end
459
+
460
+ # Get Flows encryption key status
461
+ # Read the RSA business public key registered on the phone number for WhatsApp Flows endpoint encryption. Only one key is active per phone number at a time. Flows that use flow_action: data_exchange (an endpoint-backed flow) stop working at runtime until the endpoint serves the matching private key, and Meta rejects publish with error code 139002 (\&quot;Missing Flows Signed Public Key\&quot;) when no key is registered. &#x60;registered&#x60; reflects whether a key is present, never &#x60;signatureStatus&#x60; alone: Meta reports an unregistered key as MISMATCH rather than a null/absent value.
462
+ # @param account_id [String] WhatsApp social account ID
463
+ # @param [Hash] opts the optional parameters
464
+ # @return [Array<(GetWhatsAppFlowsEncryptionKey200Response, Integer, Hash)>] GetWhatsAppFlowsEncryptionKey200Response data, response status code and response headers
465
+ def get_whats_app_flows_encryption_key_with_http_info(account_id, opts = {})
466
+ if @api_client.config.debugging
467
+ @api_client.config.logger.debug 'Calling API: WhatsAppFlowsApi.get_whats_app_flows_encryption_key ...'
468
+ end
469
+ # verify the required parameter 'account_id' is set
470
+ if @api_client.config.client_side_validation && account_id.nil?
471
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling WhatsAppFlowsApi.get_whats_app_flows_encryption_key"
472
+ end
473
+ # resource path
474
+ local_var_path = '/v1/whatsapp/flows/encryption-key'
475
+
476
+ # query parameters
477
+ query_params = opts[:query_params] || {}
478
+ query_params[:'accountId'] = account_id
479
+
480
+ # header parameters
481
+ header_params = opts[:header_params] || {}
482
+ # HTTP header 'Accept' (if needed)
483
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
484
+
485
+ # form parameters
486
+ form_params = opts[:form_params] || {}
487
+
488
+ # http body (model)
489
+ post_body = opts[:debug_body]
490
+
491
+ # return_type
492
+ return_type = opts[:debug_return_type] || 'GetWhatsAppFlowsEncryptionKey200Response'
493
+
494
+ # auth_names
495
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
496
+
497
+ new_options = opts.merge(
498
+ :operation => :"WhatsAppFlowsApi.get_whats_app_flows_encryption_key",
499
+ :header_params => header_params,
500
+ :query_params => query_params,
501
+ :form_params => form_params,
502
+ :body => post_body,
503
+ :auth_names => auth_names,
504
+ :return_type => return_type
505
+ )
506
+
507
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
508
+ if @api_client.config.debugging
509
+ @api_client.config.logger.debug "API called: WhatsAppFlowsApi#get_whats_app_flows_encryption_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
510
+ end
511
+ return data, status_code, headers
512
+ end
513
+
450
514
  # List flow responses
451
515
  # List the responses customers submitted when completing a flow (parsed from the nfm_reply messages received via webhook), newest first. Scope to a single flow with `flowId` — this matches responses whose flow_token carries the `<flowId>:` prefix that Zernio stamps on auto-generated tokens at send time. Responses sent with a custom integrator-supplied flow_token are not attributed to a flow.
452
516
  # @param account_id [String] WhatsApp social account ID
@@ -797,6 +861,74 @@ module Zernio
797
861
  return data, status_code, headers
798
862
  end
799
863
 
864
+ # Register a Flows encryption key
865
+ # Register (or replace) the RSA business public key for WhatsApp Flows endpoint encryption on the phone number. Uploading a new key replaces the previous one: only one key is active per phone number. The corresponding private key must be served by the flow's endpoint, or endpoint-backed flows (flow_action: data_exchange) will fail at runtime even though the key is registered.
866
+ # @param set_whats_app_flows_encryption_key_request [SetWhatsAppFlowsEncryptionKeyRequest]
867
+ # @param [Hash] opts the optional parameters
868
+ # @return [UpdateYoutubeDefaultPlaylist200Response]
869
+ def set_whats_app_flows_encryption_key(set_whats_app_flows_encryption_key_request, opts = {})
870
+ data, _status_code, _headers = set_whats_app_flows_encryption_key_with_http_info(set_whats_app_flows_encryption_key_request, opts)
871
+ data
872
+ end
873
+
874
+ # Register a Flows encryption key
875
+ # Register (or replace) the RSA business public key for WhatsApp Flows endpoint encryption on the phone number. Uploading a new key replaces the previous one: only one key is active per phone number. The corresponding private key must be served by the flow&#39;s endpoint, or endpoint-backed flows (flow_action: data_exchange) will fail at runtime even though the key is registered.
876
+ # @param set_whats_app_flows_encryption_key_request [SetWhatsAppFlowsEncryptionKeyRequest]
877
+ # @param [Hash] opts the optional parameters
878
+ # @return [Array<(UpdateYoutubeDefaultPlaylist200Response, Integer, Hash)>] UpdateYoutubeDefaultPlaylist200Response data, response status code and response headers
879
+ def set_whats_app_flows_encryption_key_with_http_info(set_whats_app_flows_encryption_key_request, opts = {})
880
+ if @api_client.config.debugging
881
+ @api_client.config.logger.debug 'Calling API: WhatsAppFlowsApi.set_whats_app_flows_encryption_key ...'
882
+ end
883
+ # verify the required parameter 'set_whats_app_flows_encryption_key_request' is set
884
+ if @api_client.config.client_side_validation && set_whats_app_flows_encryption_key_request.nil?
885
+ fail ArgumentError, "Missing the required parameter 'set_whats_app_flows_encryption_key_request' when calling WhatsAppFlowsApi.set_whats_app_flows_encryption_key"
886
+ end
887
+ # resource path
888
+ local_var_path = '/v1/whatsapp/flows/encryption-key'
889
+
890
+ # query parameters
891
+ query_params = opts[:query_params] || {}
892
+
893
+ # header parameters
894
+ header_params = opts[:header_params] || {}
895
+ # HTTP header 'Accept' (if needed)
896
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
897
+ # HTTP header 'Content-Type'
898
+ content_type = @api_client.select_header_content_type(['application/json'])
899
+ if !content_type.nil?
900
+ header_params['Content-Type'] = content_type
901
+ end
902
+
903
+ # form parameters
904
+ form_params = opts[:form_params] || {}
905
+
906
+ # http body (model)
907
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(set_whats_app_flows_encryption_key_request)
908
+
909
+ # return_type
910
+ return_type = opts[:debug_return_type] || 'UpdateYoutubeDefaultPlaylist200Response'
911
+
912
+ # auth_names
913
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
914
+
915
+ new_options = opts.merge(
916
+ :operation => :"WhatsAppFlowsApi.set_whats_app_flows_encryption_key",
917
+ :header_params => header_params,
918
+ :query_params => query_params,
919
+ :form_params => form_params,
920
+ :body => post_body,
921
+ :auth_names => auth_names,
922
+ :return_type => return_type
923
+ )
924
+
925
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
926
+ if @api_client.config.debugging
927
+ @api_client.config.logger.debug "API called: WhatsAppFlowsApi#set_whats_app_flows_encryption_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
928
+ end
929
+ return data, status_code, headers
930
+ end
931
+
800
932
  # Update flow
801
933
  # Update metadata (name, categories, endpointUri) of a DRAFT flow. Published flows are immutable.
802
934
  # @param flow_id [String] Flow ID
@@ -0,0 +1,204 @@
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 GetWhatsAppFlowsEncryptionKey200Response < ApiModelBase
18
+ # The registered RSA public key in PEM format, or null when none is registered.
19
+ attr_accessor :public_key
20
+
21
+ # VALID (key matches Meta's records) or MISMATCH (no key registered, or the key does not match); null when unknown.
22
+ attr_accessor :signature_status
23
+
24
+ # Whether a key is currently registered. Derived from publicKey, not signatureStatus.
25
+ attr_accessor :registered
26
+
27
+ class EnumAttributeValidator
28
+ attr_reader :datatype
29
+ attr_reader :allowable_values
30
+
31
+ def initialize(datatype, allowable_values)
32
+ @allowable_values = allowable_values.map do |value|
33
+ case datatype.to_s
34
+ when /Integer/i
35
+ value.to_i
36
+ when /Float/i
37
+ value.to_f
38
+ else
39
+ value
40
+ end
41
+ end
42
+ end
43
+
44
+ def valid?(value)
45
+ !value || allowable_values.include?(value)
46
+ end
47
+ end
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'public_key' => :'publicKey',
53
+ :'signature_status' => :'signatureStatus',
54
+ :'registered' => :'registered'
55
+ }
56
+ end
57
+
58
+ # Returns attribute mapping this model knows about
59
+ def self.acceptable_attribute_map
60
+ attribute_map
61
+ end
62
+
63
+ # Returns all the JSON keys this model knows about
64
+ def self.acceptable_attributes
65
+ acceptable_attribute_map.values
66
+ end
67
+
68
+ # Attribute type mapping.
69
+ def self.openapi_types
70
+ {
71
+ :'public_key' => :'String',
72
+ :'signature_status' => :'String',
73
+ :'registered' => :'Boolean'
74
+ }
75
+ end
76
+
77
+ # List of attributes with nullable: true
78
+ def self.openapi_nullable
79
+ Set.new([
80
+ :'public_key',
81
+ :'signature_status',
82
+ ])
83
+ end
84
+
85
+ # Initializes the object
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ def initialize(attributes = {})
88
+ if (!attributes.is_a?(Hash))
89
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetWhatsAppFlowsEncryptionKey200Response` initialize method"
90
+ end
91
+
92
+ # check to see if the attribute exists and convert string to symbol for hash key
93
+ acceptable_attribute_map = self.class.acceptable_attribute_map
94
+ attributes = attributes.each_with_object({}) { |(k, v), h|
95
+ if (!acceptable_attribute_map.key?(k.to_sym))
96
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetWhatsAppFlowsEncryptionKey200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
97
+ end
98
+ h[k.to_sym] = v
99
+ }
100
+
101
+ if attributes.key?(:'public_key')
102
+ self.public_key = attributes[:'public_key']
103
+ end
104
+
105
+ if attributes.key?(:'signature_status')
106
+ self.signature_status = attributes[:'signature_status']
107
+ end
108
+
109
+ if attributes.key?(:'registered')
110
+ self.registered = attributes[:'registered']
111
+ end
112
+ end
113
+
114
+ # Show invalid properties with the reasons. Usually used together with valid?
115
+ # @return Array for valid properties with the reasons
116
+ def list_invalid_properties
117
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
118
+ invalid_properties = Array.new
119
+ invalid_properties
120
+ end
121
+
122
+ # Check to see if the all the properties in the model are valid
123
+ # @return true if the model is valid
124
+ def valid?
125
+ warn '[DEPRECATED] the `valid?` method is obsolete'
126
+ signature_status_validator = EnumAttributeValidator.new('String', ["VALID", "MISMATCH"])
127
+ return false unless signature_status_validator.valid?(@signature_status)
128
+ true
129
+ end
130
+
131
+ # Custom attribute writer method checking allowed values (enum).
132
+ # @param [Object] signature_status Object to be assigned
133
+ def signature_status=(signature_status)
134
+ validator = EnumAttributeValidator.new('String', ["VALID", "MISMATCH"])
135
+ unless validator.valid?(signature_status)
136
+ fail ArgumentError, "invalid value for \"signature_status\", must be one of #{validator.allowable_values}."
137
+ end
138
+ @signature_status = signature_status
139
+ end
140
+
141
+ # Checks equality by comparing each attribute.
142
+ # @param [Object] Object to be compared
143
+ def ==(o)
144
+ return true if self.equal?(o)
145
+ self.class == o.class &&
146
+ public_key == o.public_key &&
147
+ signature_status == o.signature_status &&
148
+ registered == o.registered
149
+ end
150
+
151
+ # @see the `==` method
152
+ # @param [Object] Object to be compared
153
+ def eql?(o)
154
+ self == o
155
+ end
156
+
157
+ # Calculates hash code according to all attributes.
158
+ # @return [Integer] Hash code
159
+ def hash
160
+ [public_key, signature_status, registered].hash
161
+ end
162
+
163
+ # Builds the object from hash
164
+ # @param [Hash] attributes Model attributes in the form of hash
165
+ # @return [Object] Returns the model itself
166
+ def self.build_from_hash(attributes)
167
+ return nil unless attributes.is_a?(Hash)
168
+ attributes = attributes.transform_keys(&:to_sym)
169
+ transformed_hash = {}
170
+ openapi_types.each_pair do |key, type|
171
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
172
+ transformed_hash["#{key}"] = nil
173
+ elsif type =~ /\AArray<(.*)>/i
174
+ # check to ensure the input is an array given that the attribute
175
+ # is documented as an array but the input is not
176
+ if attributes[attribute_map[key]].is_a?(Array)
177
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
178
+ end
179
+ elsif !attributes[attribute_map[key]].nil?
180
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
181
+ end
182
+ end
183
+ new(transformed_hash)
184
+ end
185
+
186
+ # Returns the object in the form of hash
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_hash
189
+ hash = {}
190
+ self.class.attribute_map.each_pair do |attr, param|
191
+ value = self.send(attr)
192
+ if value.nil?
193
+ is_nullable = self.class.openapi_nullable.include?(attr)
194
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
195
+ end
196
+
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ end
203
+
204
+ end