zernio-sdk 0.0.534 → 0.0.535

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -0
  3. data/docs/CreateSmsSenderId200Response.md +22 -0
  4. data/docs/CreateSmsSenderIdRequest.md +18 -0
  5. data/docs/DeleteSmsSenderId200Response.md +18 -0
  6. data/docs/ListSmsSenderIds200Response.md +20 -0
  7. data/docs/ListSmsSenderIds200ResponseBudget.md +24 -0
  8. data/docs/ListSmsSenderIds200ResponseBudgetPendingRequest.md +22 -0
  9. data/docs/ListSmsSenderIds200ResponseSenderIdsInner.md +24 -0
  10. data/docs/RequestSmsSenderIdLimitIncrease200Response.md +20 -0
  11. data/docs/RequestSmsSenderIdLimitIncreaseRequest.md +20 -0
  12. data/docs/SMSApi.md +276 -1
  13. data/docs/SendSmsRequest.md +1 -1
  14. data/lib/zernio-sdk/api/sms_api.rb +256 -2
  15. data/lib/zernio-sdk/models/create_sms_sender_id200_response.rb +166 -0
  16. data/lib/zernio-sdk/models/create_sms_sender_id_request.rb +183 -0
  17. data/lib/zernio-sdk/models/delete_sms_sender_id200_response.rb +147 -0
  18. data/lib/zernio-sdk/models/list_sms_sender_ids200_response.rb +158 -0
  19. data/lib/zernio-sdk/models/list_sms_sender_ids200_response_budget.rb +178 -0
  20. data/lib/zernio-sdk/models/list_sms_sender_ids200_response_budget_pending_request.rb +167 -0
  21. data/lib/zernio-sdk/models/list_sms_sender_ids200_response_sender_ids_inner.rb +175 -0
  22. data/lib/zernio-sdk/models/request_sms_sender_id_limit_increase200_response.rb +156 -0
  23. data/lib/zernio-sdk/models/request_sms_sender_id_limit_increase_request.rb +210 -0
  24. data/lib/zernio-sdk/models/send_sms_request.rb +1 -1
  25. data/lib/zernio-sdk/version.rb +1 -1
  26. data/lib/zernio-sdk.rb +9 -0
  27. data/openapi.yaml +163 -5
  28. data/spec/api/sms_api_spec.rb +47 -1
  29. data/spec/models/create_sms_sender_id200_response_spec.rb +48 -0
  30. data/spec/models/create_sms_sender_id_request_spec.rb +36 -0
  31. data/spec/models/delete_sms_sender_id200_response_spec.rb +36 -0
  32. data/spec/models/list_sms_sender_ids200_response_budget_pending_request_spec.rb +48 -0
  33. data/spec/models/list_sms_sender_ids200_response_budget_spec.rb +54 -0
  34. data/spec/models/list_sms_sender_ids200_response_sender_ids_inner_spec.rb +54 -0
  35. data/spec/models/list_sms_sender_ids200_response_spec.rb +42 -0
  36. data/spec/models/request_sms_sender_id_limit_increase200_response_spec.rb +42 -0
  37. data/spec/models/request_sms_sender_id_limit_increase_request_spec.rb +42 -0
  38. metadata +37 -1
@@ -93,6 +93,74 @@ module Zernio
93
93
  return data, status_code, headers
94
94
  end
95
95
 
96
+ # Create an alphanumeric sender ID
97
+ # Registers an alphanumeric sender ID (e.g. `ZERNIO`) — a branded `from` for one-way international SMS. No phone number purchase or carrier registration is needed; once created, pass it as `from` on `POST /v1/sms/messages`. Constraints: 3-11 characters (letters, digits, spaces; at least one letter). Sends cannot reach the US, Canada, or Puerto Rico, are text-only, and recipients cannot reply. Sender IDs that impersonate well-known brands or institutions are rejected, and an ID already registered by another workspace returns 409 (active sender IDs are globally unique, first-come-first-served). Creating the same sender ID again is a no-op (re-activates it after a delete).
98
+ # @param create_sms_sender_id_request [CreateSmsSenderIdRequest]
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [CreateSmsSenderId200Response]
101
+ def create_sms_sender_id(create_sms_sender_id_request, opts = {})
102
+ data, _status_code, _headers = create_sms_sender_id_with_http_info(create_sms_sender_id_request, opts)
103
+ data
104
+ end
105
+
106
+ # Create an alphanumeric sender ID
107
+ # Registers an alphanumeric sender ID (e.g. `ZERNIO`) — a branded `from` for one-way international SMS. No phone number purchase or carrier registration is needed; once created, pass it as `from` on `POST /v1/sms/messages`. Constraints: 3-11 characters (letters, digits, spaces; at least one letter). Sends cannot reach the US, Canada, or Puerto Rico, are text-only, and recipients cannot reply. Sender IDs that impersonate well-known brands or institutions are rejected, and an ID already registered by another workspace returns 409 (active sender IDs are globally unique, first-come-first-served). Creating the same sender ID again is a no-op (re-activates it after a delete).
108
+ # @param create_sms_sender_id_request [CreateSmsSenderIdRequest]
109
+ # @param [Hash] opts the optional parameters
110
+ # @return [Array<(CreateSmsSenderId200Response, Integer, Hash)>] CreateSmsSenderId200Response data, response status code and response headers
111
+ def create_sms_sender_id_with_http_info(create_sms_sender_id_request, opts = {})
112
+ if @api_client.config.debugging
113
+ @api_client.config.logger.debug 'Calling API: SMSApi.create_sms_sender_id ...'
114
+ end
115
+ # verify the required parameter 'create_sms_sender_id_request' is set
116
+ if @api_client.config.client_side_validation && create_sms_sender_id_request.nil?
117
+ fail ArgumentError, "Missing the required parameter 'create_sms_sender_id_request' when calling SMSApi.create_sms_sender_id"
118
+ end
119
+ # resource path
120
+ local_var_path = '/v1/sms/sender-ids'
121
+
122
+ # query parameters
123
+ query_params = opts[:query_params] || {}
124
+
125
+ # header parameters
126
+ header_params = opts[:header_params] || {}
127
+ # HTTP header 'Accept' (if needed)
128
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
129
+ # HTTP header 'Content-Type'
130
+ content_type = @api_client.select_header_content_type(['application/json'])
131
+ if !content_type.nil?
132
+ header_params['Content-Type'] = content_type
133
+ end
134
+
135
+ # form parameters
136
+ form_params = opts[:form_params] || {}
137
+
138
+ # http body (model)
139
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_sms_sender_id_request)
140
+
141
+ # return_type
142
+ return_type = opts[:debug_return_type] || 'CreateSmsSenderId200Response'
143
+
144
+ # auth_names
145
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
146
+
147
+ new_options = opts.merge(
148
+ :operation => :"SMSApi.create_sms_sender_id",
149
+ :header_params => header_params,
150
+ :query_params => query_params,
151
+ :form_params => form_params,
152
+ :body => post_body,
153
+ :auth_names => auth_names,
154
+ :return_type => return_type
155
+ )
156
+
157
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
158
+ if @api_client.config.debugging
159
+ @api_client.config.logger.debug "API called: SMSApi#create_sms_sender_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
160
+ end
161
+ return data, status_code, headers
162
+ end
163
+
96
164
  # Deactivate a brand/campaign registration
97
165
  # Terminates the campaign with the carrier registry so the recurring monthly campaign fee stops (carriers bill the first 3 months of a campaign regardless). Numbers covered by it can no longer SEND texts — receiving is unaffected — until they're registered under a new brand. Irreversible: a deactivated campaign cannot be restored; texting again later requires a new registration (new one-time and review fees). Idempotent.
98
166
  # @param id [String]
@@ -156,6 +224,69 @@ module Zernio
156
224
  return data, status_code, headers
157
225
  end
158
226
 
227
+ # Delete an alphanumeric sender ID
228
+ # Deactivates the sender ID so it can no longer send. Re-creating the same sender ID via `POST /v1/sms/sender-ids` re-activates it.
229
+ # @param id [String] Sender ID resource id.
230
+ # @param [Hash] opts the optional parameters
231
+ # @return [DeleteSmsSenderId200Response]
232
+ def delete_sms_sender_id(id, opts = {})
233
+ data, _status_code, _headers = delete_sms_sender_id_with_http_info(id, opts)
234
+ data
235
+ end
236
+
237
+ # Delete an alphanumeric sender ID
238
+ # Deactivates the sender ID so it can no longer send. Re-creating the same sender ID via &#x60;POST /v1/sms/sender-ids&#x60; re-activates it.
239
+ # @param id [String] Sender ID resource id.
240
+ # @param [Hash] opts the optional parameters
241
+ # @return [Array<(DeleteSmsSenderId200Response, Integer, Hash)>] DeleteSmsSenderId200Response data, response status code and response headers
242
+ def delete_sms_sender_id_with_http_info(id, opts = {})
243
+ if @api_client.config.debugging
244
+ @api_client.config.logger.debug 'Calling API: SMSApi.delete_sms_sender_id ...'
245
+ end
246
+ # verify the required parameter 'id' is set
247
+ if @api_client.config.client_side_validation && id.nil?
248
+ fail ArgumentError, "Missing the required parameter 'id' when calling SMSApi.delete_sms_sender_id"
249
+ end
250
+ # resource path
251
+ local_var_path = '/v1/sms/sender-ids/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
252
+
253
+ # query parameters
254
+ query_params = opts[:query_params] || {}
255
+
256
+ # header parameters
257
+ header_params = opts[:header_params] || {}
258
+ # HTTP header 'Accept' (if needed)
259
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
260
+
261
+ # form parameters
262
+ form_params = opts[:form_params] || {}
263
+
264
+ # http body (model)
265
+ post_body = opts[:debug_body]
266
+
267
+ # return_type
268
+ return_type = opts[:debug_return_type] || 'DeleteSmsSenderId200Response'
269
+
270
+ # auth_names
271
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
272
+
273
+ new_options = opts.merge(
274
+ :operation => :"SMSApi.delete_sms_sender_id",
275
+ :header_params => header_params,
276
+ :query_params => query_params,
277
+ :form_params => form_params,
278
+ :body => post_body,
279
+ :auth_names => auth_names,
280
+ :return_type => return_type
281
+ )
282
+
283
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
284
+ if @api_client.config.debugging
285
+ @api_client.config.logger.debug "API called: SMSApi#delete_sms_sender_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
286
+ end
287
+ return data, status_code, headers
288
+ end
289
+
159
290
  # Disable SMS on a number
160
291
  # Turns off SMS for the number (deactivates its SMS account). The carrier registration is untouched, so re-enabling later just reactivates it, with no re-registration.
161
292
  # @param id [String]
@@ -478,6 +609,61 @@ module Zernio
478
609
  return data, status_code, headers
479
610
  end
480
611
 
612
+ # List alphanumeric sender IDs
613
+ # @param [Hash] opts the optional parameters
614
+ # @return [ListSmsSenderIds200Response]
615
+ def list_sms_sender_ids(opts = {})
616
+ data, _status_code, _headers = list_sms_sender_ids_with_http_info(opts)
617
+ data
618
+ end
619
+
620
+ # List alphanumeric sender IDs
621
+ # @param [Hash] opts the optional parameters
622
+ # @return [Array<(ListSmsSenderIds200Response, Integer, Hash)>] ListSmsSenderIds200Response data, response status code and response headers
623
+ def list_sms_sender_ids_with_http_info(opts = {})
624
+ if @api_client.config.debugging
625
+ @api_client.config.logger.debug 'Calling API: SMSApi.list_sms_sender_ids ...'
626
+ end
627
+ # resource path
628
+ local_var_path = '/v1/sms/sender-ids'
629
+
630
+ # query parameters
631
+ query_params = opts[:query_params] || {}
632
+
633
+ # header parameters
634
+ header_params = opts[:header_params] || {}
635
+ # HTTP header 'Accept' (if needed)
636
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
637
+
638
+ # form parameters
639
+ form_params = opts[:form_params] || {}
640
+
641
+ # http body (model)
642
+ post_body = opts[:debug_body]
643
+
644
+ # return_type
645
+ return_type = opts[:debug_return_type] || 'ListSmsSenderIds200Response'
646
+
647
+ # auth_names
648
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
649
+
650
+ new_options = opts.merge(
651
+ :operation => :"SMSApi.list_sms_sender_ids",
652
+ :header_params => header_params,
653
+ :query_params => query_params,
654
+ :form_params => form_params,
655
+ :body => post_body,
656
+ :auth_names => auth_names,
657
+ :return_type => return_type
658
+ )
659
+
660
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
661
+ if @api_client.config.debugging
662
+ @api_client.config.logger.debug "API called: SMSApi#list_sms_sender_ids\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
663
+ end
664
+ return data, status_code, headers
665
+ end
666
+
481
667
  # Look up carrier + line type
482
668
  # Carrier name and line type (mobile / landline / voip / toll-free) for a number, plus `smsReachable` (landlines can't receive SMS). Use it to validate recipients before sending. Each lookup is billed by the carrier-data provider, so call it explicitly (e.g. pre-validating an opt-in list), not on every send.
483
669
  # @param number [String] Number to look up (E.164; formatting is normalized).
@@ -546,6 +732,74 @@ module Zernio
546
732
  return data, status_code, headers
547
733
  end
548
734
 
735
+ # Request a higher sender ID daily limit
736
+ # Asks support to raise the workspace's daily sender-ID message cap. There is no self-serve raise: the request (desired cap + use case) is reviewed manually, usually within a business day.
737
+ # @param request_sms_sender_id_limit_increase_request [RequestSmsSenderIdLimitIncreaseRequest]
738
+ # @param [Hash] opts the optional parameters
739
+ # @return [RequestSmsSenderIdLimitIncrease200Response]
740
+ def request_sms_sender_id_limit_increase(request_sms_sender_id_limit_increase_request, opts = {})
741
+ data, _status_code, _headers = request_sms_sender_id_limit_increase_with_http_info(request_sms_sender_id_limit_increase_request, opts)
742
+ data
743
+ end
744
+
745
+ # Request a higher sender ID daily limit
746
+ # Asks support to raise the workspace&#39;s daily sender-ID message cap. There is no self-serve raise: the request (desired cap + use case) is reviewed manually, usually within a business day.
747
+ # @param request_sms_sender_id_limit_increase_request [RequestSmsSenderIdLimitIncreaseRequest]
748
+ # @param [Hash] opts the optional parameters
749
+ # @return [Array<(RequestSmsSenderIdLimitIncrease200Response, Integer, Hash)>] RequestSmsSenderIdLimitIncrease200Response data, response status code and response headers
750
+ def request_sms_sender_id_limit_increase_with_http_info(request_sms_sender_id_limit_increase_request, opts = {})
751
+ if @api_client.config.debugging
752
+ @api_client.config.logger.debug 'Calling API: SMSApi.request_sms_sender_id_limit_increase ...'
753
+ end
754
+ # verify the required parameter 'request_sms_sender_id_limit_increase_request' is set
755
+ if @api_client.config.client_side_validation && request_sms_sender_id_limit_increase_request.nil?
756
+ fail ArgumentError, "Missing the required parameter 'request_sms_sender_id_limit_increase_request' when calling SMSApi.request_sms_sender_id_limit_increase"
757
+ end
758
+ # resource path
759
+ local_var_path = '/v1/sms/sender-ids/limit-request'
760
+
761
+ # query parameters
762
+ query_params = opts[:query_params] || {}
763
+
764
+ # header parameters
765
+ header_params = opts[:header_params] || {}
766
+ # HTTP header 'Accept' (if needed)
767
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
768
+ # HTTP header 'Content-Type'
769
+ content_type = @api_client.select_header_content_type(['application/json'])
770
+ if !content_type.nil?
771
+ header_params['Content-Type'] = content_type
772
+ end
773
+
774
+ # form parameters
775
+ form_params = opts[:form_params] || {}
776
+
777
+ # http body (model)
778
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(request_sms_sender_id_limit_increase_request)
779
+
780
+ # return_type
781
+ return_type = opts[:debug_return_type] || 'RequestSmsSenderIdLimitIncrease200Response'
782
+
783
+ # auth_names
784
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
785
+
786
+ new_options = opts.merge(
787
+ :operation => :"SMSApi.request_sms_sender_id_limit_increase",
788
+ :header_params => header_params,
789
+ :query_params => query_params,
790
+ :form_params => form_params,
791
+ :body => post_body,
792
+ :auth_names => auth_names,
793
+ :return_type => return_type
794
+ )
795
+
796
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
797
+ if @api_client.config.debugging
798
+ @api_client.config.logger.debug "API called: SMSApi#request_sms_sender_id_limit_increase\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
799
+ end
800
+ return data, status_code, headers
801
+ end
802
+
549
803
  # Re-send the sole-prop OTP
550
804
  # Re-sends the sole-proprietor verification PIN to the brand's mobile number — use it when the original code expired or never arrived. Only valid while the registration is pending and awaiting its OTP; rate limited to one send per minute.
551
805
  # @param id [String]
@@ -673,7 +927,7 @@ module Zernio
673
927
  end
674
928
 
675
929
  # Send an SMS/MMS
676
- # Sends an SMS (or MMS when `mediaUrls` is set) from one of your SMS-enabled numbers. At least one of `text` / `mediaUrls` is required. Both numbers are normalized to E.164, so `from` matches regardless of formatting and replies thread into the same inbox conversation. US numbers must have an approved carrier registration (`/v1/sms/registrations`) before messages deliver. **Idempotency:** send an `Idempotency-Key` header to make retries safe: same key + same body replays the original response instead of sending a second message; same key + different body returns 422; a key still in flight returns 409.
930
+ # Sends an SMS (or MMS when `mediaUrls` is set) from one of your SMS-enabled numbers, or from an approved alphanumeric sender ID (`/v1/sms/sender-ids`). At least one of `text` / `mediaUrls` is required. Numbers are normalized to E.164, so `from` matches regardless of formatting and replies thread into the same inbox conversation. US numbers must have an approved carrier registration (`/v1/sms/registrations`) before messages deliver. **Alphanumeric sender IDs** are one-way and international only: they cannot reach the US, Canada, or Puerto Rico (403), are text-only (no MMS), and recipients cannot reply. Some destination countries substitute a numeric sender to ensure delivery. **Idempotency:** send an `Idempotency-Key` header to make retries safe: same key + same body replays the original response instead of sending a second message; same key + different body returns 422; a key still in flight returns 409.
677
931
  # @param send_sms_request [SendSmsRequest]
678
932
  # @param [Hash] opts the optional parameters
679
933
  # @option opts [String] :idempotency_key Optional client-generated unique key (e.g. a UUID) that makes send retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
@@ -684,7 +938,7 @@ module Zernio
684
938
  end
685
939
 
686
940
  # Send an SMS/MMS
687
- # Sends an SMS (or MMS when &#x60;mediaUrls&#x60; is set) from one of your SMS-enabled numbers. At least one of &#x60;text&#x60; / &#x60;mediaUrls&#x60; is required. Both numbers are normalized to E.164, so &#x60;from&#x60; matches regardless of formatting and replies thread into the same inbox conversation. US numbers must have an approved carrier registration (&#x60;/v1/sms/registrations&#x60;) before messages deliver. **Idempotency:** send an &#x60;Idempotency-Key&#x60; header to make retries safe: same key + same body replays the original response instead of sending a second message; same key + different body returns 422; a key still in flight returns 409.
941
+ # Sends an SMS (or MMS when &#x60;mediaUrls&#x60; is set) from one of your SMS-enabled numbers, or from an approved alphanumeric sender ID (&#x60;/v1/sms/sender-ids&#x60;). At least one of &#x60;text&#x60; / &#x60;mediaUrls&#x60; is required. Numbers are normalized to E.164, so &#x60;from&#x60; matches regardless of formatting and replies thread into the same inbox conversation. US numbers must have an approved carrier registration (&#x60;/v1/sms/registrations&#x60;) before messages deliver. **Alphanumeric sender IDs** are one-way and international only: they cannot reach the US, Canada, or Puerto Rico (403), are text-only (no MMS), and recipients cannot reply. Some destination countries substitute a numeric sender to ensure delivery. **Idempotency:** send an &#x60;Idempotency-Key&#x60; header to make retries safe: same key + same body replays the original response instead of sending a second message; same key + different body returns 422; a key still in flight returns 409.
688
942
  # @param send_sms_request [SendSmsRequest]
689
943
  # @param [Hash] opts the optional parameters
690
944
  # @option opts [String] :idempotency_key Optional client-generated unique key (e.g. a UUID) that makes send retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
@@ -0,0 +1,166 @@
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 CreateSmsSenderId200Response < ApiModelBase
18
+ # Sender ID resource id.
19
+ attr_accessor :id
20
+
21
+ attr_accessor :sender_id
22
+
23
+ attr_accessor :is_active
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'id' => :'id',
29
+ :'sender_id' => :'senderId',
30
+ :'is_active' => :'isActive'
31
+ }
32
+ end
33
+
34
+ # Returns attribute mapping this model knows about
35
+ def self.acceptable_attribute_map
36
+ attribute_map
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ acceptable_attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'id' => :'String',
48
+ :'sender_id' => :'String',
49
+ :'is_active' => :'Boolean'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateSmsSenderId200Response` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ acceptable_attribute_map = self.class.acceptable_attribute_map
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!acceptable_attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CreateSmsSenderId200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'id')
76
+ self.id = attributes[:'id']
77
+ end
78
+
79
+ if attributes.key?(:'sender_id')
80
+ self.sender_id = attributes[:'sender_id']
81
+ end
82
+
83
+ if attributes.key?(:'is_active')
84
+ self.is_active = attributes[:'is_active']
85
+ end
86
+ end
87
+
88
+ # Show invalid properties with the reasons. Usually used together with valid?
89
+ # @return Array for valid properties with the reasons
90
+ def list_invalid_properties
91
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
92
+ invalid_properties = Array.new
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ warn '[DEPRECATED] the `valid?` method is obsolete'
100
+ true
101
+ end
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ id == o.id &&
109
+ sender_id == o.sender_id &&
110
+ is_active == o.is_active
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [id, sender_id, is_active].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ attributes = attributes.transform_keys(&:to_sym)
131
+ transformed_hash = {}
132
+ openapi_types.each_pair do |key, type|
133
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = nil
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[attribute_map[key]].is_a?(Array)
139
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
140
+ end
141
+ elsif !attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
143
+ end
144
+ end
145
+ new(transformed_hash)
146
+ end
147
+
148
+ # Returns the object in the form of hash
149
+ # @return [Hash] Returns the object in the form of hash
150
+ def to_hash
151
+ hash = {}
152
+ self.class.attribute_map.each_pair do |attr, param|
153
+ value = self.send(attr)
154
+ if value.nil?
155
+ is_nullable = self.class.openapi_nullable.include?(attr)
156
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
157
+ end
158
+
159
+ hash[param] = _to_hash(value)
160
+ end
161
+ hash
162
+ end
163
+
164
+ end
165
+
166
+ end
@@ -0,0 +1,183 @@
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 CreateSmsSenderIdRequest < ApiModelBase
18
+ # The sender ID recipients will see (3-11 letters/digits/spaces, at least one letter, no leading/trailing space).
19
+ attr_accessor :sender_id
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'sender_id' => :'senderId'
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
+ :'sender_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::CreateSmsSenderIdRequest` 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::CreateSmsSenderIdRequest`. 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?(:'sender_id')
68
+ self.sender_id = attributes[:'sender_id']
69
+ else
70
+ self.sender_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 @sender_id.nil?
80
+ invalid_properties.push('invalid value for "sender_id", sender_id cannot be nil.')
81
+ end
82
+
83
+ if @sender_id.to_s.length > 11
84
+ invalid_properties.push('invalid value for "sender_id", the character length must be smaller than or equal to 11.')
85
+ end
86
+
87
+ if @sender_id.to_s.length < 3
88
+ invalid_properties.push('invalid value for "sender_id", the character length must be greater than or equal to 3.')
89
+ end
90
+
91
+ invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ warn '[DEPRECATED] the `valid?` method is obsolete'
98
+ return false if @sender_id.nil?
99
+ return false if @sender_id.to_s.length > 11
100
+ return false if @sender_id.to_s.length < 3
101
+ true
102
+ end
103
+
104
+ # Custom attribute writer method with validation
105
+ # @param [Object] sender_id Value to be assigned
106
+ def sender_id=(sender_id)
107
+ if sender_id.nil?
108
+ fail ArgumentError, 'sender_id cannot be nil'
109
+ end
110
+
111
+ if sender_id.to_s.length > 11
112
+ fail ArgumentError, 'invalid value for "sender_id", the character length must be smaller than or equal to 11.'
113
+ end
114
+
115
+ if sender_id.to_s.length < 3
116
+ fail ArgumentError, 'invalid value for "sender_id", the character length must be greater than or equal to 3.'
117
+ end
118
+
119
+ @sender_id = sender_id
120
+ end
121
+
122
+ # Checks equality by comparing each attribute.
123
+ # @param [Object] Object to be compared
124
+ def ==(o)
125
+ return true if self.equal?(o)
126
+ self.class == o.class &&
127
+ sender_id == o.sender_id
128
+ end
129
+
130
+ # @see the `==` method
131
+ # @param [Object] Object to be compared
132
+ def eql?(o)
133
+ self == o
134
+ end
135
+
136
+ # Calculates hash code according to all attributes.
137
+ # @return [Integer] Hash code
138
+ def hash
139
+ [sender_id].hash
140
+ end
141
+
142
+ # Builds the object from hash
143
+ # @param [Hash] attributes Model attributes in the form of hash
144
+ # @return [Object] Returns the model itself
145
+ def self.build_from_hash(attributes)
146
+ return nil unless attributes.is_a?(Hash)
147
+ attributes = attributes.transform_keys(&:to_sym)
148
+ transformed_hash = {}
149
+ openapi_types.each_pair do |key, type|
150
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
151
+ transformed_hash["#{key}"] = nil
152
+ elsif type =~ /\AArray<(.*)>/i
153
+ # check to ensure the input is an array given that the attribute
154
+ # is documented as an array but the input is not
155
+ if attributes[attribute_map[key]].is_a?(Array)
156
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
157
+ end
158
+ elsif !attributes[attribute_map[key]].nil?
159
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
160
+ end
161
+ end
162
+ new(transformed_hash)
163
+ end
164
+
165
+ # Returns the object in the form of hash
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_hash
168
+ hash = {}
169
+ self.class.attribute_map.each_pair do |attr, param|
170
+ value = self.send(attr)
171
+ if value.nil?
172
+ is_nullable = self.class.openapi_nullable.include?(attr)
173
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
174
+ end
175
+
176
+ hash[param] = _to_hash(value)
177
+ end
178
+ hash
179
+ end
180
+
181
+ end
182
+
183
+ end