late-sdk 0.0.691 → 0.0.693

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: b37cfa09d6b3550aac2a1d67795444e2901936164366b5856b511485ecdabd35
4
- data.tar.gz: 351eca4be8ad2d79b8696c32562a87644c83b4f543450cf75ed79a4dbf68cff0
3
+ metadata.gz: 4ea0f9ee1752ad92338bb01e0d42c18881ef2222078582fe728262165d300f54
4
+ data.tar.gz: a1927d051b49900061c884b72f41260d419bc7688839cc05ae7898a7106a2f93
5
5
  SHA512:
6
- metadata.gz: 12771245792d498a567d88509c0eff842a130c6d763f73ca5488681838e1c4a5dfbe98e7d2500e453200d309f3af354c4426de0e36f4135e3a9bb1e61aa7320b
7
- data.tar.gz: 6a9e1acbf662ca46711939e3683c2e3c0e094152eb8981bb6cbbcf884ec9f89fadf82fb727b3b670b0f3f6ad09534aefa0ecfe29c545d3efcad728bb4f22f7e1
6
+ metadata.gz: a6b13e0e95bb1f99cced7cae8b22138baf0dd76f6edbde5be38dfe8bc0aeb27643b49ddbe5519cf7e36c67fe9011c1a603df0f1b69565100908d358acf55cd17
7
+ data.tar.gz: 870fb575e289bffe4528ace8c24d56c1348958aae7ef94e25c6447c3bba510394a8d9e3c1d3fbf3d5185d3aea6e66a706673fd016cba1c59a8ad66052d4808ef
data/README.md CHANGED
@@ -583,6 +583,7 @@ Class | Method | HTTP request | Description
583
583
  *Zernio::WhatsAppPhoneNumbersApi* | [**get_whats_app_phone_number**](docs/WhatsAppPhoneNumbersApi.md#get_whats_app_phone_number) | **GET** /v1/whatsapp/phone-numbers/{phoneNumberId} | Get phone number
584
584
  *Zernio::WhatsAppPhoneNumbersApi* | [**get_whats_app_phone_numbers**](docs/WhatsAppPhoneNumbersApi.md#get_whats_app_phone_numbers) | **GET** /v1/whatsapp/phone-numbers | List phone numbers
585
585
  *Zernio::WhatsAppPhoneNumbersApi* | [**list_whats_app_number_countries**](docs/WhatsAppPhoneNumbersApi.md#list_whats_app_number_countries) | **GET** /v1/whatsapp/phone-numbers/countries | List offerable number countries
586
+ *Zernio::WhatsAppPhoneNumbersApi* | [**move_whats_app_number_to_profile**](docs/WhatsAppPhoneNumbersApi.md#move_whats_app_number_to_profile) | **PATCH** /v1/whatsapp/phone-numbers/{id}/profile | Move a number to another profile
586
587
  *Zernio::WhatsAppPhoneNumbersApi* | [**purchase_whats_app_phone_number**](docs/WhatsAppPhoneNumbersApi.md#purchase_whats_app_phone_number) | **POST** /v1/whatsapp/phone-numbers/purchase | Purchase phone number
587
588
  *Zernio::WhatsAppPhoneNumbersApi* | [**release_whats_app_phone_number**](docs/WhatsAppPhoneNumbersApi.md#release_whats_app_phone_number) | **DELETE** /v1/whatsapp/phone-numbers/{phoneNumberId} | Release phone number
588
589
  *Zernio::WhatsAppPhoneNumbersApi* | [**remediate_whats_app_number**](docs/WhatsAppPhoneNumbersApi.md#remediate_whats_app_number) | **POST** /v1/whatsapp/phone-numbers/{id}/remediate | Resubmit a declined number
@@ -1587,6 +1588,8 @@ Class | Method | HTTP request | Description
1587
1588
  - [Zernio::MoneyAmount](docs/MoneyAmount.md)
1588
1589
  - [Zernio::MoveAccountToProfile200Response](docs/MoveAccountToProfile200Response.md)
1589
1590
  - [Zernio::MoveAccountToProfileRequest](docs/MoveAccountToProfileRequest.md)
1591
+ - [Zernio::MoveWhatsAppNumberToProfile200Response](docs/MoveWhatsAppNumberToProfile200Response.md)
1592
+ - [Zernio::MoveWhatsAppNumberToProfileRequest](docs/MoveWhatsAppNumberToProfileRequest.md)
1590
1593
  - [Zernio::OnVerificationApprovedRequest](docs/OnVerificationApprovedRequest.md)
1591
1594
  - [Zernio::OnVerificationApprovedRequestVerification](docs/OnVerificationApprovedRequestVerification.md)
1592
1595
  - [Zernio::OnVerificationFailedRequest](docs/OnVerificationFailedRequest.md)
@@ -0,0 +1,22 @@
1
+ # Zernio::MoveWhatsAppNumberToProfile200Response
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **message** | **String** | | [optional] |
8
+ | **profile_id** | **String** | The profile the number is now on. | [optional] |
9
+ | **moved_platforms** | **Array<String>** | Platforms whose accounts travelled with the number (phone, sms, whatsapp). Absent when the number was already on the destination profile. | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'zernio-sdk'
15
+
16
+ instance = Zernio::MoveWhatsAppNumberToProfile200Response.new(
17
+ message: null,
18
+ profile_id: null,
19
+ moved_platforms: null
20
+ )
21
+ ```
22
+
@@ -0,0 +1,18 @@
1
+ # Zernio::MoveWhatsAppNumberToProfileRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **profile_id** | **String** | Destination profile id. Must belong to the same team. | |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'zernio-sdk'
13
+
14
+ instance = Zernio::MoveWhatsAppNumberToProfileRequest.new(
15
+ profile_id: null
16
+ )
17
+ ```
18
+
@@ -12,6 +12,7 @@ All URIs are relative to *https://zernio.com/api*
12
12
  | [**get_whats_app_phone_number**](WhatsAppPhoneNumbersApi.md#get_whats_app_phone_number) | **GET** /v1/whatsapp/phone-numbers/{phoneNumberId} | Get phone number |
13
13
  | [**get_whats_app_phone_numbers**](WhatsAppPhoneNumbersApi.md#get_whats_app_phone_numbers) | **GET** /v1/whatsapp/phone-numbers | List phone numbers |
14
14
  | [**list_whats_app_number_countries**](WhatsAppPhoneNumbersApi.md#list_whats_app_number_countries) | **GET** /v1/whatsapp/phone-numbers/countries | List offerable number countries |
15
+ | [**move_whats_app_number_to_profile**](WhatsAppPhoneNumbersApi.md#move_whats_app_number_to_profile) | **PATCH** /v1/whatsapp/phone-numbers/{id}/profile | Move a number to another profile |
15
16
  | [**purchase_whats_app_phone_number**](WhatsAppPhoneNumbersApi.md#purchase_whats_app_phone_number) | **POST** /v1/whatsapp/phone-numbers/purchase | Purchase phone number |
16
17
  | [**release_whats_app_phone_number**](WhatsAppPhoneNumbersApi.md#release_whats_app_phone_number) | **DELETE** /v1/whatsapp/phone-numbers/{phoneNumberId} | Release phone number |
17
18
  | [**remediate_whats_app_number**](WhatsAppPhoneNumbersApi.md#remediate_whats_app_number) | **POST** /v1/whatsapp/phone-numbers/{id}/remediate | Resubmit a declined number |
@@ -582,6 +583,77 @@ This endpoint does not need any parameter.
582
583
  - **Accept**: application/json
583
584
 
584
585
 
586
+ ## move_whats_app_number_to_profile
587
+
588
+ > <MoveWhatsAppNumberToProfile200Response> move_whats_app_number_to_profile(id, move_whats_app_number_to_profile_request)
589
+
590
+ Move a number to another profile
591
+
592
+ Move a provisioned number to a different profile. A number is not a single record. Alongside the number itself there are hidden telephony owner accounts (platform `phone`, plus `sms` when SMS is enabled) and, once WhatsApp is connected, the `whatsapp` account. They all carry a profileId and this endpoint moves them together. Use this instead of `PATCH /v1/accounts/{accountId}`: that one moves the social account only and leaves the number itself pinned to its original profile, which splits the number across two profiles. Connecting a provisioned number always places it on the profile the NUMBER is on, so a `profileId` passed to `GET /v1/connect/whatsapp` cannot re-home it and a later reconnect pulls the account back. This endpoint is how you re-home it. `id` is the number record id from `GET /v1/phone-numbers`, not an account id. A profile holds at most one account per platform, so the destination must be free of every platform this number occupies.
593
+
594
+ ### Examples
595
+
596
+ ```ruby
597
+ require 'time'
598
+ require 'zernio-sdk'
599
+ # setup authorization
600
+ Zernio.configure do |config|
601
+ # Configure Bearer authorization (JWT): bearerAuth
602
+ config.access_token = 'YOUR_BEARER_TOKEN'
603
+ end
604
+
605
+ api_instance = Zernio::WhatsAppPhoneNumbersApi.new
606
+ id = 'id_example' # String | WhatsAppPhoneNumber id.
607
+ move_whats_app_number_to_profile_request = Zernio::MoveWhatsAppNumberToProfileRequest.new({profile_id: 'profile_id_example'}) # MoveWhatsAppNumberToProfileRequest |
608
+
609
+ begin
610
+ # Move a number to another profile
611
+ result = api_instance.move_whats_app_number_to_profile(id, move_whats_app_number_to_profile_request)
612
+ p result
613
+ rescue Zernio::ApiError => e
614
+ puts "Error when calling WhatsAppPhoneNumbersApi->move_whats_app_number_to_profile: #{e}"
615
+ end
616
+ ```
617
+
618
+ #### Using the move_whats_app_number_to_profile_with_http_info variant
619
+
620
+ This returns an Array which contains the response data, status code and headers.
621
+
622
+ > <Array(<MoveWhatsAppNumberToProfile200Response>, Integer, Hash)> move_whats_app_number_to_profile_with_http_info(id, move_whats_app_number_to_profile_request)
623
+
624
+ ```ruby
625
+ begin
626
+ # Move a number to another profile
627
+ data, status_code, headers = api_instance.move_whats_app_number_to_profile_with_http_info(id, move_whats_app_number_to_profile_request)
628
+ p status_code # => 2xx
629
+ p headers # => { ... }
630
+ p data # => <MoveWhatsAppNumberToProfile200Response>
631
+ rescue Zernio::ApiError => e
632
+ puts "Error when calling WhatsAppPhoneNumbersApi->move_whats_app_number_to_profile_with_http_info: #{e}"
633
+ end
634
+ ```
635
+
636
+ ### Parameters
637
+
638
+ | Name | Type | Description | Notes |
639
+ | ---- | ---- | ----------- | ----- |
640
+ | **id** | **String** | WhatsAppPhoneNumber id. | |
641
+ | **move_whats_app_number_to_profile_request** | [**MoveWhatsAppNumberToProfileRequest**](MoveWhatsAppNumberToProfileRequest.md) | | |
642
+
643
+ ### Return type
644
+
645
+ [**MoveWhatsAppNumberToProfile200Response**](MoveWhatsAppNumberToProfile200Response.md)
646
+
647
+ ### Authorization
648
+
649
+ [bearerAuth](../README.md#bearerAuth)
650
+
651
+ ### HTTP request headers
652
+
653
+ - **Content-Type**: application/json
654
+ - **Accept**: application/json
655
+
656
+
585
657
  ## purchase_whats_app_phone_number
586
658
 
587
659
  > <PurchaseWhatsAppPhoneNumber200Response> purchase_whats_app_phone_number(purchase_whats_app_phone_number_request)
@@ -546,6 +546,80 @@ module Zernio
546
546
  return data, status_code, headers
547
547
  end
548
548
 
549
+ # Move a number to another profile
550
+ # Move a provisioned number to a different profile. A number is not a single record. Alongside the number itself there are hidden telephony owner accounts (platform `phone`, plus `sms` when SMS is enabled) and, once WhatsApp is connected, the `whatsapp` account. They all carry a profileId and this endpoint moves them together. Use this instead of `PATCH /v1/accounts/{accountId}`: that one moves the social account only and leaves the number itself pinned to its original profile, which splits the number across two profiles. Connecting a provisioned number always places it on the profile the NUMBER is on, so a `profileId` passed to `GET /v1/connect/whatsapp` cannot re-home it and a later reconnect pulls the account back. This endpoint is how you re-home it. `id` is the number record id from `GET /v1/phone-numbers`, not an account id. A profile holds at most one account per platform, so the destination must be free of every platform this number occupies.
551
+ # @param id [String] WhatsAppPhoneNumber id.
552
+ # @param move_whats_app_number_to_profile_request [MoveWhatsAppNumberToProfileRequest]
553
+ # @param [Hash] opts the optional parameters
554
+ # @return [MoveWhatsAppNumberToProfile200Response]
555
+ def move_whats_app_number_to_profile(id, move_whats_app_number_to_profile_request, opts = {})
556
+ data, _status_code, _headers = move_whats_app_number_to_profile_with_http_info(id, move_whats_app_number_to_profile_request, opts)
557
+ data
558
+ end
559
+
560
+ # Move a number to another profile
561
+ # Move a provisioned number to a different profile. A number is not a single record. Alongside the number itself there are hidden telephony owner accounts (platform &#x60;phone&#x60;, plus &#x60;sms&#x60; when SMS is enabled) and, once WhatsApp is connected, the &#x60;whatsapp&#x60; account. They all carry a profileId and this endpoint moves them together. Use this instead of &#x60;PATCH /v1/accounts/{accountId}&#x60;: that one moves the social account only and leaves the number itself pinned to its original profile, which splits the number across two profiles. Connecting a provisioned number always places it on the profile the NUMBER is on, so a &#x60;profileId&#x60; passed to &#x60;GET /v1/connect/whatsapp&#x60; cannot re-home it and a later reconnect pulls the account back. This endpoint is how you re-home it. &#x60;id&#x60; is the number record id from &#x60;GET /v1/phone-numbers&#x60;, not an account id. A profile holds at most one account per platform, so the destination must be free of every platform this number occupies.
562
+ # @param id [String] WhatsAppPhoneNumber id.
563
+ # @param move_whats_app_number_to_profile_request [MoveWhatsAppNumberToProfileRequest]
564
+ # @param [Hash] opts the optional parameters
565
+ # @return [Array<(MoveWhatsAppNumberToProfile200Response, Integer, Hash)>] MoveWhatsAppNumberToProfile200Response data, response status code and response headers
566
+ def move_whats_app_number_to_profile_with_http_info(id, move_whats_app_number_to_profile_request, opts = {})
567
+ if @api_client.config.debugging
568
+ @api_client.config.logger.debug 'Calling API: WhatsAppPhoneNumbersApi.move_whats_app_number_to_profile ...'
569
+ end
570
+ # verify the required parameter 'id' is set
571
+ if @api_client.config.client_side_validation && id.nil?
572
+ fail ArgumentError, "Missing the required parameter 'id' when calling WhatsAppPhoneNumbersApi.move_whats_app_number_to_profile"
573
+ end
574
+ # verify the required parameter 'move_whats_app_number_to_profile_request' is set
575
+ if @api_client.config.client_side_validation && move_whats_app_number_to_profile_request.nil?
576
+ fail ArgumentError, "Missing the required parameter 'move_whats_app_number_to_profile_request' when calling WhatsAppPhoneNumbersApi.move_whats_app_number_to_profile"
577
+ end
578
+ # resource path
579
+ local_var_path = '/v1/whatsapp/phone-numbers/{id}/profile'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
580
+
581
+ # query parameters
582
+ query_params = opts[:query_params] || {}
583
+
584
+ # header parameters
585
+ header_params = opts[:header_params] || {}
586
+ # HTTP header 'Accept' (if needed)
587
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
588
+ # HTTP header 'Content-Type'
589
+ content_type = @api_client.select_header_content_type(['application/json'])
590
+ if !content_type.nil?
591
+ header_params['Content-Type'] = content_type
592
+ end
593
+
594
+ # form parameters
595
+ form_params = opts[:form_params] || {}
596
+
597
+ # http body (model)
598
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(move_whats_app_number_to_profile_request)
599
+
600
+ # return_type
601
+ return_type = opts[:debug_return_type] || 'MoveWhatsAppNumberToProfile200Response'
602
+
603
+ # auth_names
604
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
605
+
606
+ new_options = opts.merge(
607
+ :operation => :"WhatsAppPhoneNumbersApi.move_whats_app_number_to_profile",
608
+ :header_params => header_params,
609
+ :query_params => query_params,
610
+ :form_params => form_params,
611
+ :body => post_body,
612
+ :auth_names => auth_names,
613
+ :return_type => return_type
614
+ )
615
+
616
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
617
+ if @api_client.config.debugging
618
+ @api_client.config.logger.debug "API called: WhatsAppPhoneNumbersApi#move_whats_app_number_to_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
619
+ end
620
+ return data, status_code, headers
621
+ end
622
+
549
623
  # Purchase phone number
550
624
  # Deprecated alias of `/v1/phone-numbers/purchase`; same contract. New integrations should use that path. Payment-first: you do not pick a specific number, the system provisions one and auto-assigns it. With usage-based billing active and a payment method on file, the number provisions inline and bills per month on your usage-based invoice (there is no checkout redirect). No payment method on file returns `402 PAYMENT_REQUIRED`; a regulated country returns `202` with `status: \"kyc_required\"` and a `kycUrl`. Requires usage-based billing (the Usage plan). The maximum number of phone numbers is determined by the user's plan.
551
625
  # @param purchase_whats_app_phone_number_request [PurchaseWhatsAppPhoneNumberRequest]
@@ -0,0 +1,169 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
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 MoveWhatsAppNumberToProfile200Response < ApiModelBase
18
+ attr_accessor :message
19
+
20
+ # The profile the number is now on.
21
+ attr_accessor :profile_id
22
+
23
+ # Platforms whose accounts travelled with the number (phone, sms, whatsapp). Absent when the number was already on the destination profile.
24
+ attr_accessor :moved_platforms
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'message' => :'message',
30
+ :'profile_id' => :'profileId',
31
+ :'moved_platforms' => :'movedPlatforms'
32
+ }
33
+ end
34
+
35
+ # Returns attribute mapping this model knows about
36
+ def self.acceptable_attribute_map
37
+ attribute_map
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ acceptable_attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'message' => :'String',
49
+ :'profile_id' => :'String',
50
+ :'moved_platforms' => :'Array<String>'
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::MoveWhatsAppNumberToProfile200Response` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ acceptable_attribute_map = self.class.acceptable_attribute_map
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!acceptable_attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::MoveWhatsAppNumberToProfile200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'message')
77
+ self.message = attributes[:'message']
78
+ end
79
+
80
+ if attributes.key?(:'profile_id')
81
+ self.profile_id = attributes[:'profile_id']
82
+ end
83
+
84
+ if attributes.key?(:'moved_platforms')
85
+ if (value = attributes[:'moved_platforms']).is_a?(Array)
86
+ self.moved_platforms = value
87
+ end
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
+ invalid_properties = Array.new
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ true
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ message == o.message &&
112
+ profile_id == o.profile_id &&
113
+ moved_platforms == o.moved_platforms
114
+ end
115
+
116
+ # @see the `==` method
117
+ # @param [Object] Object to be compared
118
+ def eql?(o)
119
+ self == o
120
+ end
121
+
122
+ # Calculates hash code according to all attributes.
123
+ # @return [Integer] Hash code
124
+ def hash
125
+ [message, profile_id, moved_platforms].hash
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def self.build_from_hash(attributes)
132
+ return nil unless attributes.is_a?(Hash)
133
+ attributes = attributes.transform_keys(&:to_sym)
134
+ transformed_hash = {}
135
+ openapi_types.each_pair do |key, type|
136
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
137
+ transformed_hash["#{key}"] = nil
138
+ elsif type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[attribute_map[key]].is_a?(Array)
142
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
143
+ end
144
+ elsif !attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
146
+ end
147
+ end
148
+ new(transformed_hash)
149
+ end
150
+
151
+ # Returns the object in the form of hash
152
+ # @return [Hash] Returns the object in the form of hash
153
+ def to_hash
154
+ hash = {}
155
+ self.class.attribute_map.each_pair do |attr, param|
156
+ value = self.send(attr)
157
+ if value.nil?
158
+ is_nullable = self.class.openapi_nullable.include?(attr)
159
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
160
+ end
161
+
162
+ hash[param] = _to_hash(value)
163
+ end
164
+ hash
165
+ end
166
+
167
+ end
168
+
169
+ end
@@ -0,0 +1,165 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
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 MoveWhatsAppNumberToProfileRequest < ApiModelBase
18
+ # Destination profile id. Must belong to the same team.
19
+ attr_accessor :profile_id
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'profile_id' => :'profileId'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'profile_id' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::MoveWhatsAppNumberToProfileRequest` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::MoveWhatsAppNumberToProfileRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'profile_id')
68
+ self.profile_id = attributes[:'profile_id']
69
+ else
70
+ self.profile_id = nil
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
+ invalid_properties = Array.new
79
+ if @profile_id.nil?
80
+ invalid_properties.push('invalid value for "profile_id", profile_id cannot be nil.')
81
+ end
82
+
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ warn '[DEPRECATED] the `valid?` method is obsolete'
90
+ return false if @profile_id.nil?
91
+ true
92
+ end
93
+
94
+ # Custom attribute writer method with validation
95
+ # @param [Object] profile_id Value to be assigned
96
+ def profile_id=(profile_id)
97
+ if profile_id.nil?
98
+ fail ArgumentError, 'profile_id cannot be nil'
99
+ end
100
+
101
+ @profile_id = profile_id
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ profile_id == o.profile_id
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [profile_id].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ transformed_hash = {}
131
+ openapi_types.each_pair do |key, type|
132
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = nil
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[attribute_map[key]].is_a?(Array)
138
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
139
+ end
140
+ elsif !attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
142
+ end
143
+ end
144
+ new(transformed_hash)
145
+ end
146
+
147
+ # Returns the object in the form of hash
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = self.send(attr)
153
+ if value.nil?
154
+ is_nullable = self.class.openapi_nullable.include?(attr)
155
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
156
+ end
157
+
158
+ hash[param] = _to_hash(value)
159
+ end
160
+ hash
161
+ end
162
+
163
+ end
164
+
165
+ end
@@ -11,5 +11,5 @@ Generator version: 7.19.0
11
11
  =end
12
12
 
13
13
  module Zernio
14
- VERSION = '0.0.691'
14
+ VERSION = '0.0.693'
15
15
  end
data/lib/zernio-sdk.rb CHANGED
@@ -993,6 +993,8 @@ require 'zernio-sdk/models/money'
993
993
  require 'zernio-sdk/models/money_amount'
994
994
  require 'zernio-sdk/models/move_account_to_profile200_response'
995
995
  require 'zernio-sdk/models/move_account_to_profile_request'
996
+ require 'zernio-sdk/models/move_whats_app_number_to_profile200_response'
997
+ require 'zernio-sdk/models/move_whats_app_number_to_profile_request'
996
998
  require 'zernio-sdk/models/on_verification_approved_request'
997
999
  require 'zernio-sdk/models/on_verification_approved_request_verification'
998
1000
  require 'zernio-sdk/models/on_verification_failed_request'
data/openapi.yaml CHANGED
@@ -19523,6 +19523,7 @@ paths:
19523
19523
  value:
19524
19524
  status: "expired"
19525
19525
  message: "Access code has expired. Please generate a new one."
19526
+ '400': { $ref: '#/components/responses/BadRequest' }
19526
19527
  '401': { $ref: '#/components/responses/Unauthorized' }
19527
19528
  '404': { description: Code not found }
19528
19529
  '500': { description: Internal error }
@@ -32260,6 +32261,64 @@ paths:
32260
32261
  '400': { description: Country does not require KYC (not a regulated country). }
32261
32262
  '401': { $ref: '#/components/responses/Unauthorized' }
32262
32263
 
32264
+ /v1/whatsapp/phone-numbers/{id}/profile:
32265
+ patch:
32266
+ x-resource-group: "telephony"
32267
+ operationId: moveWhatsAppNumberToProfile
32268
+ tags: [WhatsApp Phone Numbers]
32269
+ summary: Move a number to another profile
32270
+ description: |
32271
+ Move a provisioned number to a different profile.
32272
+
32273
+ A number is not a single record. Alongside the number itself there are
32274
+ hidden telephony owner accounts (platform `phone`, plus `sms` when SMS is
32275
+ enabled) and, once WhatsApp is connected, the `whatsapp` account. They all
32276
+ carry a profileId and this endpoint moves them together.
32277
+
32278
+ Use this instead of `PATCH /v1/accounts/{accountId}`: that one moves the
32279
+ social account only and leaves the number itself pinned to its original
32280
+ profile, which splits the number across two profiles. Connecting a
32281
+ provisioned number always places it on the profile the NUMBER is on, so a
32282
+ `profileId` passed to `GET /v1/connect/whatsapp` cannot re-home it and a
32283
+ later reconnect pulls the account back. This endpoint is how you re-home it.
32284
+
32285
+ `id` is the number record id from `GET /v1/phone-numbers`, not an account id.
32286
+
32287
+ A profile holds at most one account per platform, so the destination must be
32288
+ free of every platform this number occupies.
32289
+ security:
32290
+ - bearerAuth: []
32291
+ parameters:
32292
+ - { name: id, in: path, required: true, schema: { type: string }, description: WhatsAppPhoneNumber id. }
32293
+ requestBody:
32294
+ required: true
32295
+ content:
32296
+ application/json:
32297
+ schema:
32298
+ type: object
32299
+ required: [profileId]
32300
+ properties:
32301
+ profileId: { type: string, description: Destination profile id. Must belong to the same team. }
32302
+ responses:
32303
+ '200':
32304
+ description: Number moved, or already on that profile.
32305
+ content:
32306
+ application/json:
32307
+ schema:
32308
+ type: object
32309
+ properties:
32310
+ message: { type: string }
32311
+ profileId: { type: string, description: The profile the number is now on. }
32312
+ movedPlatforms:
32313
+ type: array
32314
+ items: { type: string }
32315
+ description: 'Platforms whose accounts travelled with the number (phone, sms, whatsapp). Absent when the number was already on the destination profile.'
32316
+ '400': { $ref: '#/components/responses/BadRequest' }
32317
+ '401': { $ref: '#/components/responses/Unauthorized' }
32318
+ '403': { description: 'No access to the source or destination profile, or the Inbox add-on is not active.' }
32319
+ '404': { description: 'Number not found, or the destination profile does not exist.' }
32320
+ '409': { description: 'The destination profile already holds an account on one of the platforms this number occupies.' }
32321
+
32263
32322
  /v1/whatsapp/phone-numbers/{id}/remediate:
32264
32323
  get:
32265
32324
  x-resource-group: "telephony"
@@ -131,6 +131,19 @@ describe 'WhatsAppPhoneNumbersApi' do
131
131
  end
132
132
  end
133
133
 
134
+ # unit tests for move_whats_app_number_to_profile
135
+ # Move a number to another profile
136
+ # Move a provisioned number to a different profile. A number is not a single record. Alongside the number itself there are hidden telephony owner accounts (platform &#x60;phone&#x60;, plus &#x60;sms&#x60; when SMS is enabled) and, once WhatsApp is connected, the &#x60;whatsapp&#x60; account. They all carry a profileId and this endpoint moves them together. Use this instead of &#x60;PATCH /v1/accounts/{accountId}&#x60;: that one moves the social account only and leaves the number itself pinned to its original profile, which splits the number across two profiles. Connecting a provisioned number always places it on the profile the NUMBER is on, so a &#x60;profileId&#x60; passed to &#x60;GET /v1/connect/whatsapp&#x60; cannot re-home it and a later reconnect pulls the account back. This endpoint is how you re-home it. &#x60;id&#x60; is the number record id from &#x60;GET /v1/phone-numbers&#x60;, not an account id. A profile holds at most one account per platform, so the destination must be free of every platform this number occupies.
137
+ # @param id WhatsAppPhoneNumber id.
138
+ # @param move_whats_app_number_to_profile_request
139
+ # @param [Hash] opts the optional parameters
140
+ # @return [MoveWhatsAppNumberToProfile200Response]
141
+ describe 'move_whats_app_number_to_profile test' do
142
+ it 'should work' do
143
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
144
+ end
145
+ end
146
+
134
147
  # unit tests for purchase_whats_app_phone_number
135
148
  # Purchase phone number
136
149
  # Deprecated alias of &#x60;/v1/phone-numbers/purchase&#x60;; same contract. New integrations should use that path. Payment-first: you do not pick a specific number, the system provisions one and auto-assigns it. With usage-based billing active and a payment method on file, the number provisions inline and bills per month on your usage-based invoice (there is no checkout redirect). No payment method on file returns &#x60;402 PAYMENT_REQUIRED&#x60;; a regulated country returns &#x60;202&#x60; with &#x60;status: \&quot;kyc_required\&quot;&#x60; and a &#x60;kycUrl&#x60;. Requires usage-based billing (the Usage plan). The maximum number of phone numbers is determined by the user&#39;s plan.
@@ -0,0 +1,48 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for Zernio::MoveWhatsAppNumberToProfile200Response
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe Zernio::MoveWhatsAppNumberToProfile200Response do
21
+ #let(:instance) { Zernio::MoveWhatsAppNumberToProfile200Response.new }
22
+
23
+ describe 'test an instance of MoveWhatsAppNumberToProfile200Response' do
24
+ it 'should create an instance of MoveWhatsAppNumberToProfile200Response' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(Zernio::MoveWhatsAppNumberToProfile200Response)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "message"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ describe 'test attribute "profile_id"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ end
40
+ end
41
+
42
+ describe 'test attribute "moved_platforms"' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
45
+ end
46
+ end
47
+
48
+ end
@@ -0,0 +1,36 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for Zernio::MoveWhatsAppNumberToProfileRequest
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe Zernio::MoveWhatsAppNumberToProfileRequest do
21
+ #let(:instance) { Zernio::MoveWhatsAppNumberToProfileRequest.new }
22
+
23
+ describe 'test an instance of MoveWhatsAppNumberToProfileRequest' do
24
+ it 'should create an instance of MoveWhatsAppNumberToProfileRequest' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(Zernio::MoveWhatsAppNumberToProfileRequest)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "profile_id"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: late-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.691
4
+ version: 0.0.693
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator
@@ -1077,6 +1077,8 @@ files:
1077
1077
  - docs/MoneyAmount.md
1078
1078
  - docs/MoveAccountToProfile200Response.md
1079
1079
  - docs/MoveAccountToProfileRequest.md
1080
+ - docs/MoveWhatsAppNumberToProfile200Response.md
1081
+ - docs/MoveWhatsAppNumberToProfileRequest.md
1080
1082
  - docs/OnVerificationApprovedRequest.md
1081
1083
  - docs/OnVerificationApprovedRequestVerification.md
1082
1084
  - docs/OnVerificationFailedRequest.md
@@ -2759,6 +2761,8 @@ files:
2759
2761
  - lib/zernio-sdk/models/money_amount.rb
2760
2762
  - lib/zernio-sdk/models/move_account_to_profile200_response.rb
2761
2763
  - lib/zernio-sdk/models/move_account_to_profile_request.rb
2764
+ - lib/zernio-sdk/models/move_whats_app_number_to_profile200_response.rb
2765
+ - lib/zernio-sdk/models/move_whats_app_number_to_profile_request.rb
2762
2766
  - lib/zernio-sdk/models/on_verification_approved_request.rb
2763
2767
  - lib/zernio-sdk/models/on_verification_approved_request_verification.rb
2764
2768
  - lib/zernio-sdk/models/on_verification_failed_request.rb
@@ -4409,6 +4413,8 @@ files:
4409
4413
  - spec/models/money_spec.rb
4410
4414
  - spec/models/move_account_to_profile200_response_spec.rb
4411
4415
  - spec/models/move_account_to_profile_request_spec.rb
4416
+ - spec/models/move_whats_app_number_to_profile200_response_spec.rb
4417
+ - spec/models/move_whats_app_number_to_profile_request_spec.rb
4412
4418
  - spec/models/on_verification_approved_request_spec.rb
4413
4419
  - spec/models/on_verification_approved_request_verification_spec.rb
4414
4420
  - spec/models/on_verification_failed_request_spec.rb
@@ -5018,7 +5024,7 @@ files:
5018
5024
  - spec/models/you_tube_video_retention_response_retention_curve_inner_spec.rb
5019
5025
  - spec/models/you_tube_video_retention_response_spec.rb
5020
5026
  - spec/spec_helper.rb
5021
- - zernio-sdk-0.0.691.gem
5027
+ - zernio-sdk-0.0.693.gem
5022
5028
  - zernio-sdk.gemspec
5023
5029
  homepage: https://openapi-generator.tech
5024
5030
  licenses:
@@ -5424,6 +5430,7 @@ test_files:
5424
5430
  - spec/models/list_inbox_conversations200_response_data_inner_metadata_spec.rb
5425
5431
  - spec/models/inbox_message_edit_attachment_spec.rb
5426
5432
  - spec/models/list_google_business_place_actions200_response_place_action_links_inner_spec.rb
5433
+ - spec/models/move_whats_app_number_to_profile200_response_spec.rb
5427
5434
  - spec/models/shared_ad_account_spec.rb
5428
5435
  - spec/models/remediate_phone_number_request_spec.rb
5429
5436
  - spec/models/get_webhook_logs200_response_pagination_spec.rb
@@ -5959,6 +5966,7 @@ test_files:
5959
5966
  - spec/models/get_dsa_recommendations200_response_spec.rb
5960
5967
  - spec/models/profile_get_response_spec.rb
5961
5968
  - spec/models/delete_google_business_media200_response_spec.rb
5969
+ - spec/models/move_whats_app_number_to_profile_request_spec.rb
5962
5970
  - spec/models/you_tube_daily_views_response_date_range_spec.rb
5963
5971
  - spec/models/send_broadcast200_response_spec.rb
5964
5972
  - spec/models/update_webhook_settings200_response_spec.rb
Binary file