Class: Zernio::IMessageApi

Inherits:
Object
  • Object
show all
Defined in:
lib/zernio-sdk/api/i_message_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ IMessageApi

Returns a new instance of IMessageApi.



19
20
21
# File 'lib/zernio-sdk/api/i_message_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_client ⇒ Object

Returns the value of attribute api_client.



17
18
19
# File 'lib/zernio-sdk/api/i_message_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_imessage_group_participant(conversation_id, add_imessage_group_participant_request, opts = {}) ⇒ AddImessageGroupParticipant200Response

Add a participant to an iMessage group Applied asynchronously by the provider; the participant list on the next group webhook reflects it.

Parameters:

Returns:



28
29
30
31
# File 'lib/zernio-sdk/api/i_message_api.rb', line 28

def add_imessage_group_participant(conversation_id, add_imessage_group_participant_request, opts = {})
  data, _status_code, _headers = add_imessage_group_participant_with_http_info(conversation_id, add_imessage_group_participant_request, opts)
  data
end

#add_imessage_group_participant_with_http_info(conversation_id, add_imessage_group_participant_request, opts = {}) ⇒ Array<(AddImessageGroupParticipant200Response, Integer, Hash)>

Add a participant to an iMessage group Applied asynchronously by the provider; the participant list on the next group webhook reflects it.

Parameters:

Returns:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/zernio-sdk/api/i_message_api.rb', line 39

def add_imessage_group_participant_with_http_info(conversation_id, add_imessage_group_participant_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IMessageApi.add_imessage_group_participant ...'
  end
  # verify the required parameter 'conversation_id' is set
  if @api_client.config.client_side_validation && conversation_id.nil?
    fail ArgumentError, "Missing the required parameter 'conversation_id' when calling IMessageApi.add_imessage_group_participant"
  end
  # verify the required parameter 'add_imessage_group_participant_request' is set
  if @api_client.config.client_side_validation && add_imessage_group_participant_request.nil?
    fail ArgumentError, "Missing the required parameter 'add_imessage_group_participant_request' when calling IMessageApi.add_imessage_group_participant"
  end
  # resource path
  local_var_path = '/v1/imessage/groups/{conversationId}/participants'.sub('{' + 'conversationId' + '}', CGI.escape(conversation_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(add_imessage_group_participant_request)

  # return_type
  return_type = opts[:debug_return_type] || 'AddImessageGroupParticipant200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"IMessageApi.add_imessage_group_participant",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IMessageApi#add_imessage_group_participant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#cancel_imessage_sender(sender_id, opts = {}) ⇒ OrderImessageSender202Response

Cancel an iMessage sender Cancels the sender at the provider and deactivates its messaging account. Billing stops with the current month (no proration or refunds, matching phone numbers). A sender still being set up (status ordering or activating) cannot be canceled; contact support to change the order.

Parameters:

  • sender_id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



101
102
103
104
# File 'lib/zernio-sdk/api/i_message_api.rb', line 101

def cancel_imessage_sender(sender_id, opts = {})
  data, _status_code, _headers = cancel_imessage_sender_with_http_info(sender_id, opts)
  data
end

#cancel_imessage_sender_with_http_info(sender_id, opts = {}) ⇒ Array<(OrderImessageSender202Response, Integer, Hash)>

Cancel an iMessage sender Cancels the sender at the provider and deactivates its messaging account. Billing stops with the current month (no proration or refunds, matching phone numbers). A sender still being set up (status ordering or activating) cannot be canceled; contact support to change the order.

Parameters:

  • sender_id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/zernio-sdk/api/i_message_api.rb', line 111

def cancel_imessage_sender_with_http_info(sender_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IMessageApi.cancel_imessage_sender ...'
  end
  # verify the required parameter 'sender_id' is set
  if @api_client.config.client_side_validation && sender_id.nil?
    fail ArgumentError, "Missing the required parameter 'sender_id' when calling IMessageApi.cancel_imessage_sender"
  end
  # resource path
  local_var_path = '/v1/imessage/senders/{senderId}'.sub('{' + 'senderId' + '}', CGI.escape(sender_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'OrderImessageSender202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"IMessageApi.cancel_imessage_sender",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IMessageApi#cancel_imessage_sender\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_imessage_group(create_imessage_group_request, opts = {}) ⇒ CreateImessageGroup202Response

Start an iMessage group chat Creates a group chat from one of your senders and sends its first message. The provider processes it asynchronously: the response carries the request id, and the thread appears in the inbox (with its group conversation id) on the first webhook. Starting a group counts as messaging new contacts, so the sender needs the provider's init-conversations add-on and the same sending intervals apply; without it the request fails with 409 recipient_must_message_first. WhatsApp groups need a name.

Parameters:

Returns:



164
165
166
167
# File 'lib/zernio-sdk/api/i_message_api.rb', line 164

def create_imessage_group(create_imessage_group_request, opts = {})
  data, _status_code, _headers = create_imessage_group_with_http_info(create_imessage_group_request, opts)
  data
end

#create_imessage_group_with_http_info(create_imessage_group_request, opts = {}) ⇒ Array<(CreateImessageGroup202Response, Integer, Hash)>

Start an iMessage group chat Creates a group chat from one of your senders and sends its first message. The provider processes it asynchronously: the response carries the request id, and the thread appears in the inbox (with its group conversation id) on the first webhook. Starting a group counts as messaging new contacts, so the sender needs the provider's init-conversations add-on and the same sending intervals apply; without it the request fails with 409 `recipient_must_message_first`. WhatsApp groups need a `name`.

Parameters:

Returns:



174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/zernio-sdk/api/i_message_api.rb', line 174

def create_imessage_group_with_http_info(create_imessage_group_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IMessageApi.create_imessage_group ...'
  end
  # verify the required parameter 'create_imessage_group_request' is set
  if @api_client.config.client_side_validation && create_imessage_group_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_imessage_group_request' when calling IMessageApi.create_imessage_group"
  end
  # resource path
  local_var_path = '/v1/imessage/groups'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_imessage_group_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateImessageGroup202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"IMessageApi.create_imessage_group",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IMessageApi#create_imessage_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Create a tracked iMessage opt-in link Generates a per-campaign link that opens Messages on this sender with body prefilled. A thread the contact opens skips the pacing and the first-message content rule that apply when the sender writes first, and it is the only way in for senders without the add-on for new contacts (their sends to anyone else fail with recipient_must_message_first). Each link carries a unique code in place of the [opt-in-code] placeholder; when the contact sends it, the resulting message.received webhook (and the stored inbox message's metadata) has optIn: true and your parameters under optInParameters, so you can attribute the conversation to the campaign or lead that produced it. For an untracked link, use the sender's optInLink instead.

Parameters:

Returns:



233
234
235
236
# File 'lib/zernio-sdk/api/i_message_api.rb', line 233

def create_imessage_opt_in_link(sender_id, create_imessage_opt_in_link_request, opts = {})
  data, _status_code, _headers = create_imessage_opt_in_link_with_http_info(sender_id, create_imessage_opt_in_link_request, opts)
  data
end

Create a tracked iMessage opt-in link Generates a per-campaign link that opens Messages on this sender with `body` prefilled. A thread the contact opens skips the pacing and the first-message content rule that apply when the sender writes first, and it is the only way in for senders without the add-on for new contacts (their sends to anyone else fail with `recipient_must_message_first`). Each link carries a unique code in place of the `[opt-in-code]` placeholder; when the contact sends it, the resulting `message.received` webhook (and the stored inbox message's `metadata`) has `optIn: true` and your `parameters` under `optInParameters`, so you can attribute the conversation to the campaign or lead that produced it. For an untracked link, use the sender's `optInLink` instead.

Parameters:

Returns:



244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
# File 'lib/zernio-sdk/api/i_message_api.rb', line 244

def create_imessage_opt_in_link_with_http_info(sender_id, create_imessage_opt_in_link_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IMessageApi.create_imessage_opt_in_link ...'
  end
  # verify the required parameter 'sender_id' is set
  if @api_client.config.client_side_validation && sender_id.nil?
    fail ArgumentError, "Missing the required parameter 'sender_id' when calling IMessageApi.create_imessage_opt_in_link"
  end
  # verify the required parameter 'create_imessage_opt_in_link_request' is set
  if @api_client.config.client_side_validation && create_imessage_opt_in_link_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_imessage_opt_in_link_request' when calling IMessageApi.create_imessage_opt_in_link"
  end
  # resource path
  local_var_path = '/v1/imessage/senders/{senderId}/opt-in-links'.sub('{' + 'senderId' + '}', CGI.escape(sender_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_imessage_opt_in_link_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateImessageOptInLink200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"IMessageApi.create_imessage_opt_in_link",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IMessageApi#create_imessage_opt_in_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_imessage_group(conversation_id, account_id, opts = {}) ⇒ GetImessageGroup200Response

Get an iMessage group The group's name, participants and channel as the provider currently sees them. The conversation must be a group thread of the given account.

Parameters:

  • conversation_id (String) —

    The inbox conversation id (or the provider group id)

  • account_id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



307
308
309
310
# File 'lib/zernio-sdk/api/i_message_api.rb', line 307

def get_imessage_group(conversation_id, , opts = {})
  data, _status_code, _headers = get_imessage_group_with_http_info(conversation_id, , opts)
  data
end

#get_imessage_group_with_http_info(conversation_id, account_id, opts = {}) ⇒ Array<(GetImessageGroup200Response, Integer, Hash)>

Get an iMessage group The group's name, participants and channel as the provider currently sees them. The conversation must be a group thread of the given account.

Parameters:

  • conversation_id (String) —

    The inbox conversation id (or the provider group id)

  • account_id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(GetImessageGroup200Response, Integer, Hash)>) —

    GetImessageGroup200Response data, response status code and response headers



318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# File 'lib/zernio-sdk/api/i_message_api.rb', line 318

def get_imessage_group_with_http_info(conversation_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IMessageApi.get_imessage_group ...'
  end
  # verify the required parameter 'conversation_id' is set
  if @api_client.config.client_side_validation && conversation_id.nil?
    fail ArgumentError, "Missing the required parameter 'conversation_id' when calling IMessageApi.get_imessage_group"
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling IMessageApi.get_imessage_group"
  end
  # resource path
  local_var_path = '/v1/imessage/groups/{conversationId}'.sub('{' + 'conversationId' + '}', CGI.escape(conversation_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetImessageGroup200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"IMessageApi.get_imessage_group",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IMessageApi#get_imessage_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_imessage_sender(sender_id, opts = {}) ⇒ GetImessageSender200Response

Get iMessage sender status Lifecycle status of an ordered or registered sender (poll while an order activates), plus the provider's live platform health for it.

Parameters:

  • sender_id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



376
377
378
379
# File 'lib/zernio-sdk/api/i_message_api.rb', line 376

def get_imessage_sender(sender_id, opts = {})
  data, _status_code, _headers = get_imessage_sender_with_http_info(sender_id, opts)
  data
end

#get_imessage_sender_with_http_info(sender_id, opts = {}) ⇒ Array<(GetImessageSender200Response, Integer, Hash)>

Get iMessage sender status Lifecycle status of an ordered or registered sender (poll while an order activates), plus the provider's live platform health for it.

Parameters:

  • sender_id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
# File 'lib/zernio-sdk/api/i_message_api.rb', line 386

def get_imessage_sender_with_http_info(sender_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IMessageApi.get_imessage_sender ...'
  end
  # verify the required parameter 'sender_id' is set
  if @api_client.config.client_side_validation && sender_id.nil?
    fail ArgumentError, "Missing the required parameter 'sender_id' when calling IMessageApi.get_imessage_sender"
  end
  # resource path
  local_var_path = '/v1/imessage/senders/{senderId}'.sub('{' + 'senderId' + '}', CGI.escape(sender_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetImessageSender200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"IMessageApi.get_imessage_sender",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IMessageApi#get_imessage_sender\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_imessage_audience(opts = {}) ⇒ ListImessageAudience200Response

List iMessage audience Contacts who have messaged your iMessage senders (1:1 threads), with subscription state and, for threads opened through a tracked opt-in link, the parameters that brought them in. Newest activity first.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :account_id (String) —

    Limit to one sender account

  • :status (String)
  • :search (String) —

    Matches the contact handle or name

  • :limit (Integer) — default: default to 50
  • :skip (Integer) — default: default to 0

Returns:



443
444
445
446
# File 'lib/zernio-sdk/api/i_message_api.rb', line 443

def list_imessage_audience(opts = {})
  data, _status_code, _headers = list_imessage_audience_with_http_info(opts)
  data
end

#list_imessage_audience_with_http_info(opts = {}) ⇒ Array<(ListImessageAudience200Response, Integer, Hash)>

List iMessage audience Contacts who have messaged your iMessage senders (1:1 threads), with subscription state and, for threads opened through a tracked opt-in link, the parameters that brought them in. Newest activity first.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :account_id (String) —

    Limit to one sender account

  • :status (String)
  • :search (String) —

    Matches the contact handle or name

  • :limit (Integer) — default: default to 50
  • :skip (Integer) — default: default to 0

Returns:



457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
# File 'lib/zernio-sdk/api/i_message_api.rb', line 457

def list_imessage_audience_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IMessageApi.list_imessage_audience ...'
  end
  allowable_values = ["subscribed", "unsubscribed"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'search'].nil? && opts[:'search'].to_s.length > 120
    fail ArgumentError, 'invalid value for "opts[:"search"]" when calling IMessageApi.list_imessage_audience, the character length must be smaller than or equal to 120.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 200
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling IMessageApi.list_imessage_audience, must be smaller than or equal to 200.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling IMessageApi.list_imessage_audience, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'skip'].nil? && opts[:'skip'] < 0
    fail ArgumentError, 'invalid value for "opts[:"skip"]" when calling IMessageApi.list_imessage_audience, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/v1/imessage/audience'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListImessageAudience200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"IMessageApi.list_imessage_audience",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IMessageApi#list_imessage_audience\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_imessage_available_numbers(opts = {}) ⇒ ListImessageAvailableNumbers200Response

List instantly available iMessage numbers Phone numbers the provider has already registered and can assign on the spot. Order one by passing its id as availableNumberId to POST /v1/imessage/senders/order: the sender activates immediately instead of after the usual provisioning wait. Reserve it first with POST /v1/imessage/senders/available-numbers/numberId/reserve while the buyer decides. The list is a snapshot; a number can be taken between listing and ordering.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :region (String)

Returns:



531
532
533
534
# File 'lib/zernio-sdk/api/i_message_api.rb', line 531

def list_imessage_available_numbers(opts = {})
  data, _status_code, _headers = list_imessage_available_numbers_with_http_info(opts)
  data
end

#list_imessage_available_numbers_with_http_info(opts = {}) ⇒ Array<(ListImessageAvailableNumbers200Response, Integer, Hash)>

List instantly available iMessage numbers Phone numbers the provider has already registered and can assign on the spot. Order one by passing its `id` as `availableNumberId` to POST /v1/imessage/senders/order: the sender activates immediately instead of after the usual provisioning wait. Reserve it first with POST /v1/imessage/senders/available-numbers/numberId/reserve while the buyer decides. The list is a snapshot; a number can be taken between listing and ordering.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :region (String)

Returns:



541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
# File 'lib/zernio-sdk/api/i_message_api.rb', line 541

def list_imessage_available_numbers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IMessageApi.list_imessage_available_numbers ...'
  end
  allowable_values = ["US", "GB"]
  if @api_client.config.client_side_validation && opts[:'region'] && !allowable_values.include?(opts[:'region'])
    fail ArgumentError, "invalid value for \"region\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/imessage/senders/available-numbers'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListImessageAvailableNumbers200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"IMessageApi.list_imessage_available_numbers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IMessageApi#list_imessage_available_numbers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_imessage_sender_orders(opts = {}) ⇒ ListImessageSenderOrders200Response

List iMessage sender orders Every sender lifecycle doc your team owns (ordered or registered), across statuses. Canceled senders are omitted unless includeCanceled=true.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :include_canceled (Boolean) — default: default to false

Returns:



595
596
597
598
# File 'lib/zernio-sdk/api/i_message_api.rb', line 595

def list_imessage_sender_orders(opts = {})
  data, _status_code, _headers = list_imessage_sender_orders_with_http_info(opts)
  data
end

#list_imessage_sender_orders_with_http_info(opts = {}) ⇒ Array<(ListImessageSenderOrders200Response, Integer, Hash)>

List iMessage sender orders Every sender lifecycle doc your team owns (ordered or registered), across statuses. Canceled senders are omitted unless `includeCanceled=true`.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :include_canceled (Boolean) — default: default to false

Returns:



605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
# File 'lib/zernio-sdk/api/i_message_api.rb', line 605

def list_imessage_sender_orders_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IMessageApi.list_imessage_sender_orders ...'
  end
  # resource path
  local_var_path = '/v1/imessage/senders/order'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'includeCanceled'] = opts[:'include_canceled'] if !opts[:'include_canceled'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListImessageSenderOrders200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"IMessageApi.list_imessage_sender_orders",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IMessageApi#list_imessage_sender_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_imessage_senders(opts = {}) ⇒ ListImessageSenders200Response

List iMessage senders Lists the iMessage senders registered across your accessible profiles.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



654
655
656
657
# File 'lib/zernio-sdk/api/i_message_api.rb', line 654

def list_imessage_senders(opts = {})
  data, _status_code, _headers = list_imessage_senders_with_http_info(opts)
  data
end

#list_imessage_senders_with_http_info(opts = {}) ⇒ Array<(ListImessageSenders200Response, Integer, Hash)>

List iMessage senders Lists the iMessage senders registered across your accessible profiles.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
# File 'lib/zernio-sdk/api/i_message_api.rb', line 663

def list_imessage_senders_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IMessageApi.list_imessage_senders ...'
  end
  # resource path
  local_var_path = '/v1/imessage/senders'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListImessageSenders200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"IMessageApi.list_imessage_senders",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IMessageApi#list_imessage_senders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#order_imessage_sender(order_imessage_sender_request, opts = {}) ⇒ OrderImessageSender202Response

Order a new iMessage sender Orders a NEW dedicated iMessage sender from the delivery provider (compare with POST /v1/imessage/senders, which registers a sender you already own). Activation is asynchronous (minutes to a few hours): the response is 202 with the lifecycle object; poll GET /v1/imessage/senders/senderId or subscribe to the account.connected webhook. Billing starts at activation (monthly per sender, no proration). Requires usage-based billing and a valid payment method. Pass purchaseIntentId to make retries idempotent — the provider-side order is never retried automatically. Ordered phone senders include SMS/RCS fallback with call forwarding and the ability to message contacts who have not written first (sending intervals still apply).

Parameters:

Returns:



712
713
714
715
# File 'lib/zernio-sdk/api/i_message_api.rb', line 712

def order_imessage_sender(order_imessage_sender_request, opts = {})
  data, _status_code, _headers = order_imessage_sender_with_http_info(order_imessage_sender_request, opts)
  data
end

#order_imessage_sender_with_http_info(order_imessage_sender_request, opts = {}) ⇒ Array<(OrderImessageSender202Response, Integer, Hash)>

Order a new iMessage sender Orders a NEW dedicated iMessage sender from the delivery provider (compare with POST /v1/imessage/senders, which registers a sender you already own). Activation is asynchronous (minutes to a few hours): the response is 202 with the lifecycle object; poll GET /v1/imessage/senders/senderId or subscribe to the account.connected webhook. Billing starts at activation (monthly per sender, no proration). Requires usage-based billing and a valid payment method. Pass purchaseIntentId to make retries idempotent — the provider-side order is never retried automatically. Ordered phone senders include SMS/RCS fallback with call forwarding and the ability to message contacts who have not written first (sending intervals still apply).

Parameters:

Returns:



722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
# File 'lib/zernio-sdk/api/i_message_api.rb', line 722

def order_imessage_sender_with_http_info(order_imessage_sender_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IMessageApi.order_imessage_sender ...'
  end
  # verify the required parameter 'order_imessage_sender_request' is set
  if @api_client.config.client_side_validation && order_imessage_sender_request.nil?
    fail ArgumentError, "Missing the required parameter 'order_imessage_sender_request' when calling IMessageApi.order_imessage_sender"
  end
  # resource path
  local_var_path = '/v1/imessage/senders/order'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(order_imessage_sender_request)

  # return_type
  return_type = opts[:debug_return_type] || 'OrderImessageSender202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"IMessageApi.order_imessage_sender",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IMessageApi#order_imessage_sender\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#register_imessage_sender(register_imessage_sender_request, opts = {}) ⇒ RegisterImessageSender200Response

Register an iMessage sender Registers a provider-provisioned iMessage sender (a phone number or an email handle) that YOU already own on a profile, creating an imessage account that sends and receives through the inbox conversation endpoints. To have Zernio order a new sender for you, use POST /v1/imessage/senders/order instead. Registration attaches the monthly sender fee (billed while active) and requires a payment method (402 without one). One sender per profile: re-registering the SAME handle refreshes it; a different handle returns 409 until the existing sender is canceled.

Parameters:

Returns:



780
781
782
783
# File 'lib/zernio-sdk/api/i_message_api.rb', line 780

def register_imessage_sender(register_imessage_sender_request, opts = {})
  data, _status_code, _headers = register_imessage_sender_with_http_info(register_imessage_sender_request, opts)
  data
end

#register_imessage_sender_with_http_info(register_imessage_sender_request, opts = {}) ⇒ Array<(RegisterImessageSender200Response, Integer, Hash)>

Register an iMessage sender Registers a provider-provisioned iMessage sender (a phone number or an email handle) that YOU already own on a profile, creating an `imessage` account that sends and receives through the inbox conversation endpoints. To have Zernio order a new sender for you, use POST /v1/imessage/senders/order instead. Registration attaches the monthly sender fee (billed while active) and requires a payment method (402 without one). One sender per profile: re-registering the SAME handle refreshes it; a different handle returns 409 until the existing sender is canceled.

Parameters:

Returns:



790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
# File 'lib/zernio-sdk/api/i_message_api.rb', line 790

def register_imessage_sender_with_http_info(register_imessage_sender_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IMessageApi.register_imessage_sender ...'
  end
  # verify the required parameter 'register_imessage_sender_request' is set
  if @api_client.config.client_side_validation && register_imessage_sender_request.nil?
    fail ArgumentError, "Missing the required parameter 'register_imessage_sender_request' when calling IMessageApi.register_imessage_sender"
  end
  # resource path
  local_var_path = '/v1/imessage/senders'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(register_imessage_sender_request)

  # return_type
  return_type = opts[:debug_return_type] || 'RegisterImessageSender200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"IMessageApi.register_imessage_sender",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IMessageApi#register_imessage_sender\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_imessage_group_participant(conversation_id, account_id, contact, opts = {}) ⇒ AddImessageGroupParticipant200Response

Remove a participant from an iMessage group Applied asynchronously by the provider.

Parameters:

  • conversation_id (String)
  • account_id (String)
  • contact (String) —

    E.164 phone or iMessage email

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



850
851
852
853
# File 'lib/zernio-sdk/api/i_message_api.rb', line 850

def remove_imessage_group_participant(conversation_id, , contact, opts = {})
  data, _status_code, _headers = remove_imessage_group_participant_with_http_info(conversation_id, , contact, opts)
  data
end

#remove_imessage_group_participant_with_http_info(conversation_id, account_id, contact, opts = {}) ⇒ Array<(AddImessageGroupParticipant200Response, Integer, Hash)>

Remove a participant from an iMessage group Applied asynchronously by the provider.

Parameters:

  • conversation_id (String)
  • account_id (String)
  • contact (String) —

    E.164 phone or iMessage email

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
# File 'lib/zernio-sdk/api/i_message_api.rb', line 862

def remove_imessage_group_participant_with_http_info(conversation_id, , contact, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IMessageApi.remove_imessage_group_participant ...'
  end
  # verify the required parameter 'conversation_id' is set
  if @api_client.config.client_side_validation && conversation_id.nil?
    fail ArgumentError, "Missing the required parameter 'conversation_id' when calling IMessageApi.remove_imessage_group_participant"
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling IMessageApi.remove_imessage_group_participant"
  end
  # verify the required parameter 'contact' is set
  if @api_client.config.client_side_validation && contact.nil?
    fail ArgumentError, "Missing the required parameter 'contact' when calling IMessageApi.remove_imessage_group_participant"
  end
  # resource path
  local_var_path = '/v1/imessage/groups/{conversationId}/participants'.sub('{' + 'conversationId' + '}', CGI.escape(conversation_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'contact'] = contact

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AddImessageGroupParticipant200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"IMessageApi.remove_imessage_group_participant",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IMessageApi#remove_imessage_group_participant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reserve_imessage_available_number(number_id, opts = {}) ⇒ ReserveImessageAvailableNumber200Response

Reserve an available iMessage number Holds the number for 3 minutes so nobody else can order it while the buyer decides. Place the order (POST /v1/imessage/senders/order with availableNumberId) before the hold expires. No request body.

Parameters:

  • number_id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



925
926
927
928
# File 'lib/zernio-sdk/api/i_message_api.rb', line 925

def reserve_imessage_available_number(number_id, opts = {})
  data, _status_code, _headers = reserve_imessage_available_number_with_http_info(number_id, opts)
  data
end

#reserve_imessage_available_number_with_http_info(number_id, opts = {}) ⇒ Array<(ReserveImessageAvailableNumber200Response, Integer, Hash)>

Reserve an available iMessage number Holds the number for 3 minutes so nobody else can order it while the buyer decides. Place the order (POST /v1/imessage/senders/order with availableNumberId) before the hold expires. No request body.

Parameters:

  • number_id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
# File 'lib/zernio-sdk/api/i_message_api.rb', line 935

def reserve_imessage_available_number_with_http_info(number_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IMessageApi.reserve_imessage_available_number ...'
  end
  # verify the required parameter 'number_id' is set
  if @api_client.config.client_side_validation && number_id.nil?
    fail ArgumentError, "Missing the required parameter 'number_id' when calling IMessageApi.reserve_imessage_available_number"
  end
  # resource path
  local_var_path = '/v1/imessage/senders/available-numbers/{numberId}/reserve'.sub('{' + 'numberId' + '}', CGI.escape(number_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ReserveImessageAvailableNumber200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"IMessageApi.reserve_imessage_available_number",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IMessageApi#reserve_imessage_available_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#set_imessage_subscription(set_imessage_subscription_request, opts = {}) ⇒ SetImessageSubscription200Response

Subscribe or opt out an iMessage contact Opted-out contacts are refused at send time (409 recipient_opted_out) until re-subscribed. Their inbound messages still arrive. Scoped to your account: it does not change the contact's state with other businesses.

Parameters:

Returns:



988
989
990
991
# File 'lib/zernio-sdk/api/i_message_api.rb', line 988

def set_imessage_subscription(set_imessage_subscription_request, opts = {})
  data, _status_code, _headers = set_imessage_subscription_with_http_info(set_imessage_subscription_request, opts)
  data
end

#set_imessage_subscription_with_http_info(set_imessage_subscription_request, opts = {}) ⇒ Array<(SetImessageSubscription200Response, Integer, Hash)>

Subscribe or opt out an iMessage contact Opted-out contacts are refused at send time (409 recipient_opted_out) until re-subscribed. Their inbound messages still arrive. Scoped to your account: it does not change the contact's state with other businesses.

Parameters:

Returns:



998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
# File 'lib/zernio-sdk/api/i_message_api.rb', line 998

def set_imessage_subscription_with_http_info(set_imessage_subscription_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IMessageApi.set_imessage_subscription ...'
  end
  # verify the required parameter 'set_imessage_subscription_request' is set
  if @api_client.config.client_side_validation && set_imessage_subscription_request.nil?
    fail ArgumentError, "Missing the required parameter 'set_imessage_subscription_request' when calling IMessageApi.set_imessage_subscription"
  end
  # resource path
  local_var_path = '/v1/imessage/audience/subscription'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(set_imessage_subscription_request)

  # return_type
  return_type = opts[:debug_return_type] || 'SetImessageSubscription200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"IMessageApi.set_imessage_subscription",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IMessageApi#set_imessage_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_imessage_group(conversation_id, update_imessage_group_request, opts = {}) ⇒ UpdateImessageGroup200Response

Rename an iMessage group or change its photo One change per call: either name or photoUrl (an empty photoUrl removes the photo). Applied asynchronously by the provider; a rename is mirrored on the inbox conversation right away.

Parameters:

  • conversation_id (String)
  • update_imessage_group_request (UpdateImessageGroupRequest)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



1057
1058
1059
1060
# File 'lib/zernio-sdk/api/i_message_api.rb', line 1057

def update_imessage_group(conversation_id, update_imessage_group_request, opts = {})
  data, _status_code, _headers = update_imessage_group_with_http_info(conversation_id, update_imessage_group_request, opts)
  data
end

#update_imessage_group_with_http_info(conversation_id, update_imessage_group_request, opts = {}) ⇒ Array<(UpdateImessageGroup200Response, Integer, Hash)>

Rename an iMessage group or change its photo One change per call: either `name` or `photoUrl` (an empty `photoUrl` removes the photo). Applied asynchronously by the provider; a rename is mirrored on the inbox conversation right away.

Parameters:

  • conversation_id (String)
  • update_imessage_group_request (UpdateImessageGroupRequest)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
# File 'lib/zernio-sdk/api/i_message_api.rb', line 1068

def update_imessage_group_with_http_info(conversation_id, update_imessage_group_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IMessageApi.update_imessage_group ...'
  end
  # verify the required parameter 'conversation_id' is set
  if @api_client.config.client_side_validation && conversation_id.nil?
    fail ArgumentError, "Missing the required parameter 'conversation_id' when calling IMessageApi.update_imessage_group"
  end
  # verify the required parameter 'update_imessage_group_request' is set
  if @api_client.config.client_side_validation && update_imessage_group_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_imessage_group_request' when calling IMessageApi.update_imessage_group"
  end
  # resource path
  local_var_path = '/v1/imessage/groups/{conversationId}'.sub('{' + 'conversationId' + '}', CGI.escape(conversation_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_imessage_group_request)

  # return_type
  return_type = opts[:debug_return_type] || 'UpdateImessageGroup200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"IMessageApi.update_imessage_group",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IMessageApi#update_imessage_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_imessage_sender(sender_id, update_imessage_sender_request, opts = {}) ⇒ OrderImessageSender202Response

Update an iMessage sender Display name (inbox and API responses) and the contact card (vCard) recipients see when they save the sender. The contact card is what a contactCard send shares.

Parameters:

  • sender_id (String)
  • update_imessage_sender_request (UpdateImessageSenderRequest)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



1131
1132
1133
1134
# File 'lib/zernio-sdk/api/i_message_api.rb', line 1131

def update_imessage_sender(sender_id, update_imessage_sender_request, opts = {})
  data, _status_code, _headers = update_imessage_sender_with_http_info(sender_id, update_imessage_sender_request, opts)
  data
end

#update_imessage_sender_with_http_info(sender_id, update_imessage_sender_request, opts = {}) ⇒ Array<(OrderImessageSender202Response, Integer, Hash)>

Update an iMessage sender Display name (inbox and API responses) and the contact card (vCard) recipients see when they save the sender. The contact card is what a contactCard send shares.

Parameters:

  • sender_id (String)
  • update_imessage_sender_request (UpdateImessageSenderRequest)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
# File 'lib/zernio-sdk/api/i_message_api.rb', line 1142

def update_imessage_sender_with_http_info(sender_id, update_imessage_sender_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IMessageApi.update_imessage_sender ...'
  end
  # verify the required parameter 'sender_id' is set
  if @api_client.config.client_side_validation && sender_id.nil?
    fail ArgumentError, "Missing the required parameter 'sender_id' when calling IMessageApi.update_imessage_sender"
  end
  # verify the required parameter 'update_imessage_sender_request' is set
  if @api_client.config.client_side_validation && update_imessage_sender_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_imessage_sender_request' when calling IMessageApi.update_imessage_sender"
  end
  # resource path
  local_var_path = '/v1/imessage/senders/{senderId}'.sub('{' + 'senderId' + '}', CGI.escape(sender_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_imessage_sender_request)

  # return_type
  return_type = opts[:debug_return_type] || 'OrderImessageSender202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"IMessageApi.update_imessage_sender",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IMessageApi#update_imessage_sender\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end