Class: Zernio::WhatsAppCallingApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ WhatsAppCallingApi

Returns a new instance of WhatsAppCallingApi.



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

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



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

def api_client
  @api_client
end

Instance Method Details

#disable_whats_app_calling(id, account_id, opts = {}) ⇒ nil

Disable calling on a number Disable calling. Sends calling.status=DISABLED to Meta (best-effort) and flips the local callingEnabled flag off. forwardTo and SIP creds are preserved so a re-enable does not lose the destination.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


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

def disable_whats_app_calling(id, , opts = {})
  disable_whats_app_calling_with_http_info(id, , opts)
  nil
end

#disable_whats_app_calling_legacy(id, account_id, opts = {}) ⇒ nil

Disable calling on a number Deprecated alias of /v1/phone-numbers/{id}/whatsapp/calling; same contract. New integrations should use that path. Disable calling. Sends calling.status=DISABLED to Meta (best-effort) and flips the local callingEnabled flag off. forwardTo and SIP creds are preserved so a re-enable does not lose the destination.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


98
99
100
101
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 98

def disable_whats_app_calling_legacy(id, , opts = {})
  disable_whats_app_calling_legacy_with_http_info(id, , opts)
  nil
end

#disable_whats_app_calling_legacy_with_http_info(id, account_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Disable calling on a number Deprecated alias of `/v1/phone-numbers/id/whatsapp/calling`; same contract. New integrations should use that path. Disable calling. Sends calling.status=DISABLED to Meta (best-effort) and flips the local `callingEnabled` flag off. forwardTo and SIP creds are preserved so a re-enable does not lose the destination.

Parameters:

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

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



109
110
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
158
159
160
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 109

def disable_whats_app_calling_legacy_with_http_info(id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppCallingApi.disable_whats_app_calling_legacy ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WhatsAppCallingApi.disable_whats_app_calling_legacy"
  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 WhatsAppCallingApi.disable_whats_app_calling_legacy"
  end
  # resource path
  local_var_path = '/v1/whatsapp/phone-numbers/{id}/calling'.sub('{' + 'id' + '}', CGI.escape(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]

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

  new_options = opts.merge(
    :operation => :"WhatsAppCallingApi.disable_whats_app_calling_legacy",
    :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: WhatsAppCallingApi#disable_whats_app_calling_legacy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#disable_whats_app_calling_with_http_info(id, account_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Disable calling on a number Disable calling. Sends calling.status=DISABLED to Meta (best-effort) and flips the local `callingEnabled` flag off. forwardTo and SIP creds are preserved so a re-enable does not lose the destination.

Parameters:

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

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



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
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 39

def disable_whats_app_calling_with_http_info(id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppCallingApi.disable_whats_app_calling ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WhatsAppCallingApi.disable_whats_app_calling"
  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 WhatsAppCallingApi.disable_whats_app_calling"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/{id}/whatsapp/calling'.sub('{' + 'id' + '}', CGI.escape(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]

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

  new_options = opts.merge(
    :operation => :"WhatsAppCallingApi.disable_whats_app_calling",
    :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: WhatsAppCallingApi#disable_whats_app_calling\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#enable_whats_app_calling(id, enable_whats_app_calling_legacy_request, opts = {}) ⇒ EnableWhatsAppCallingLegacy200Response

Enable calling on a number Enable WhatsApp Business Calling on a connected number. Configures Meta calling.status=ENABLED with our Telnyx SIP endpoint, fetches and stores the Meta-issued SIP password (encrypted), and snapshots the customer's forward-to destination.

Parameters:

  • id (String)

    Phone number record ID (from GET /v1/phone-numbers).

  • enable_whats_app_calling_legacy_request (EnableWhatsAppCallingLegacyRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



168
169
170
171
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 168

def enable_whats_app_calling(id, enable_whats_app_calling_legacy_request, opts = {})
  data, _status_code, _headers = enable_whats_app_calling_with_http_info(id, enable_whats_app_calling_legacy_request, opts)
  data
end

#enable_whats_app_calling_legacy(id, enable_whats_app_calling_legacy_request, opts = {}) ⇒ EnableWhatsAppCallingLegacy200Response

Enable calling on a number Deprecated alias of /v1/phone-numbers/{id}/whatsapp/calling; same contract. New integrations should use that path. Enable WhatsApp Business Calling on a connected number. Configures Meta calling.status=ENABLED with our Telnyx SIP endpoint, fetches and stores the Meta-issued SIP password (encrypted), and snapshots the customer's forward-to destination.

Parameters:

  • id (String)

    WhatsAppPhoneNumber Mongo ID

  • enable_whats_app_calling_legacy_request (EnableWhatsAppCallingLegacyRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



242
243
244
245
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 242

def enable_whats_app_calling_legacy(id, enable_whats_app_calling_legacy_request, opts = {})
  data, _status_code, _headers = enable_whats_app_calling_legacy_with_http_info(id, enable_whats_app_calling_legacy_request, opts)
  data
end

#enable_whats_app_calling_legacy_with_http_info(id, enable_whats_app_calling_legacy_request, opts = {}) ⇒ Array<(EnableWhatsAppCallingLegacy200Response, Integer, Hash)>

Enable calling on a number Deprecated alias of `/v1/phone-numbers/id/whatsapp/calling`; same contract. New integrations should use that path. Enable WhatsApp Business Calling on a connected number. Configures Meta calling.status=ENABLED with our Telnyx SIP endpoint, fetches and stores the Meta-issued SIP password (encrypted), and snapshots the customer's forward-to destination.

Parameters:

  • id (String)

    WhatsAppPhoneNumber Mongo ID

  • enable_whats_app_calling_legacy_request (EnableWhatsAppCallingLegacyRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



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
300
301
302
303
304
305
306
307
308
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 253

def enable_whats_app_calling_legacy_with_http_info(id, enable_whats_app_calling_legacy_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppCallingApi.enable_whats_app_calling_legacy ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WhatsAppCallingApi.enable_whats_app_calling_legacy"
  end
  # verify the required parameter 'enable_whats_app_calling_legacy_request' is set
  if @api_client.config.client_side_validation && enable_whats_app_calling_legacy_request.nil?
    fail ArgumentError, "Missing the required parameter 'enable_whats_app_calling_legacy_request' when calling WhatsAppCallingApi.enable_whats_app_calling_legacy"
  end
  # resource path
  local_var_path = '/v1/whatsapp/phone-numbers/{id}/calling'.sub('{' + 'id' + '}', CGI.escape(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(enable_whats_app_calling_legacy_request)

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

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

  new_options = opts.merge(
    :operation => :"WhatsAppCallingApi.enable_whats_app_calling_legacy",
    :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: WhatsAppCallingApi#enable_whats_app_calling_legacy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#enable_whats_app_calling_with_http_info(id, enable_whats_app_calling_legacy_request, opts = {}) ⇒ Array<(EnableWhatsAppCallingLegacy200Response, Integer, Hash)>

Enable calling on a number Enable WhatsApp Business Calling on a connected number. Configures Meta calling.status=ENABLED with our Telnyx SIP endpoint, fetches and stores the Meta-issued SIP password (encrypted), and snapshots the customer's forward-to destination.

Parameters:

  • id (String)

    Phone number record ID (from GET /v1/phone-numbers).

  • enable_whats_app_calling_legacy_request (EnableWhatsAppCallingLegacyRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



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
226
227
228
229
230
231
232
233
234
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 179

def enable_whats_app_calling_with_http_info(id, enable_whats_app_calling_legacy_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppCallingApi.enable_whats_app_calling ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WhatsAppCallingApi.enable_whats_app_calling"
  end
  # verify the required parameter 'enable_whats_app_calling_legacy_request' is set
  if @api_client.config.client_side_validation && enable_whats_app_calling_legacy_request.nil?
    fail ArgumentError, "Missing the required parameter 'enable_whats_app_calling_legacy_request' when calling WhatsAppCallingApi.enable_whats_app_calling"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/{id}/whatsapp/calling'.sub('{' + 'id' + '}', CGI.escape(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(enable_whats_app_calling_legacy_request)

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

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

  new_options = opts.merge(
    :operation => :"WhatsAppCallingApi.enable_whats_app_calling",
    :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: WhatsAppCallingApi#enable_whats_app_calling\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_whats_app_call(id, account_id, opts = {}) ⇒ GetWhatsAppCall200Response

Get a single call

Parameters:

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

    the optional parameters

Returns:



315
316
317
318
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 315

def get_whats_app_call(id, , opts = {})
  data, _status_code, _headers = get_whats_app_call_with_http_info(id, , opts)
  data
end

#get_whats_app_call_estimate(account_id, to, opts = {}) ⇒ GetWhatsAppCallEstimate200Response

Estimate per-minute cost Returns a zero-markup estimated cost for an outbound call to the given destination, broken down by Meta + Telnyx + recording line items. Costs are pass-through, no margin applied.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :minutes (Integer)
  • :recording (Boolean)

Returns:



386
387
388
389
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 386

def get_whats_app_call_estimate(, to, opts = {})
  data, _status_code, _headers = get_whats_app_call_estimate_with_http_info(, to, opts)
  data
end

#get_whats_app_call_estimate_with_http_info(account_id, to, opts = {}) ⇒ Array<(GetWhatsAppCallEstimate200Response, Integer, Hash)>

Estimate per-minute cost Returns a zero-markup estimated cost for an outbound call to the given destination, broken down by Meta + Telnyx + recording line items. Costs are pass-through, no margin applied.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :minutes (Integer)
  • :recording (Boolean)

Returns:



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
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 399

def get_whats_app_call_estimate_with_http_info(, to, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppCallingApi.get_whats_app_call_estimate ...'
  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 WhatsAppCallingApi.get_whats_app_call_estimate"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling WhatsAppCallingApi.get_whats_app_call_estimate"
  end
  if @api_client.config.client_side_validation && !opts[:'minutes'].nil? && opts[:'minutes'] > 120
    fail ArgumentError, 'invalid value for "opts[:"minutes"]" when calling WhatsAppCallingApi.get_whats_app_call_estimate, must be smaller than or equal to 120.'
  end

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

  # resource path
  local_var_path = '/v1/whatsapp/calls/estimate'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'to'] = to
  query_params[:'minutes'] = opts[:'minutes'] if !opts[:'minutes'].nil?
  query_params[:'recording'] = opts[:'recording'] if !opts[:'recording'].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] || 'GetWhatsAppCallEstimate200Response'

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

  new_options = opts.merge(
    :operation => :"WhatsAppCallingApi.get_whats_app_call_estimate",
    :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: WhatsAppCallingApi#get_whats_app_call_estimate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_whats_app_call_permissions(account_id, to, opts = {}) ⇒ GetWhatsAppCallPermissions200Response

Check call permission Returns the permission state and the list of available actions for a given consumer wa_id (e.g. start_call, send_call_permission_request). Use this before placing a call to decide whether to prompt for consent first.

Parameters:

  • account_id (String)
  • to (String)

    Consumer wa_id (E.164, leading + optional)

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

    the optional parameters

Returns:



469
470
471
472
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 469

def get_whats_app_call_permissions(, to, opts = {})
  data, _status_code, _headers = get_whats_app_call_permissions_with_http_info(, to, opts)
  data
end

#get_whats_app_call_permissions_with_http_info(account_id, to, opts = {}) ⇒ Array<(GetWhatsAppCallPermissions200Response, Integer, Hash)>

Check call permission Returns the permission state and the list of available actions for a given consumer wa_id (e.g. `start_call`, `send_call_permission_request`). Use this before placing a call to decide whether to prompt for consent first.

Parameters:

  • account_id (String)
  • to (String)

    Consumer wa_id (E.164, leading + optional)

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

    the optional parameters

Returns:



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
525
526
527
528
529
530
531
532
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 480

def get_whats_app_call_permissions_with_http_info(, to, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppCallingApi.get_whats_app_call_permissions ...'
  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 WhatsAppCallingApi.get_whats_app_call_permissions"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling WhatsAppCallingApi.get_whats_app_call_permissions"
  end
  # resource path
  local_var_path = '/v1/whatsapp/call-permissions'

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

  # 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] || 'GetWhatsAppCallPermissions200Response'

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

  new_options = opts.merge(
    :operation => :"WhatsAppCallingApi.get_whats_app_call_permissions",
    :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: WhatsAppCallingApi#get_whats_app_call_permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_whats_app_call_recording(id, account_id, opts = {}) ⇒ GetWhatsAppCallRecording200Response

Get a call recording Resolves a fresh, playable MP3 URL for the call's recording. Provider-signed recording URLs expire ~10 minutes after signing, so the recordingUrl stored on the call is usually stale by the time it is played; this endpoint re-signs on demand. Default responds 302 Found redirecting to the fresh URL (point an <audio> element or a link straight at this endpoint); pass as=json to receive { url } instead.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :as (String)

    `json` returns `{ url }` instead of a 302 redirect.

Returns:



541
542
543
544
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 541

def get_whats_app_call_recording(id, , opts = {})
  data, _status_code, _headers = get_whats_app_call_recording_with_http_info(id, , opts)
  data
end

#get_whats_app_call_recording_with_http_info(id, account_id, opts = {}) ⇒ Array<(GetWhatsAppCallRecording200Response, Integer, Hash)>

Get a call recording Resolves a fresh, playable MP3 URL for the call's recording. Provider-signed recording URLs expire ~10 minutes after signing, so the `recordingUrl` stored on the call is usually stale by the time it is played; this endpoint re-signs on demand. Default responds `302 Found` redirecting to the fresh URL (point an `<audio>` element or a link straight at this endpoint); pass `as=json` to receive `{ url }` instead.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :as (String)

    `json` returns `{ url }` instead of a 302 redirect.

Returns:



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
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 553

def get_whats_app_call_recording_with_http_info(id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppCallingApi.get_whats_app_call_recording ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WhatsAppCallingApi.get_whats_app_call_recording"
  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 WhatsAppCallingApi.get_whats_app_call_recording"
  end
  allowable_values = ["json"]
  if @api_client.config.client_side_validation && opts[:'as'] && !allowable_values.include?(opts[:'as'])
    fail ArgumentError, "invalid value for \"as\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/whatsapp/calls/{id}/recording'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'as'] = opts[:'as'] if !opts[:'as'].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] || 'GetWhatsAppCallRecording200Response'

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

  new_options = opts.merge(
    :operation => :"WhatsAppCallingApi.get_whats_app_call_recording",
    :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: WhatsAppCallingApi#get_whats_app_call_recording\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_whats_app_call_with_http_info(id, account_id, opts = {}) ⇒ Array<(GetWhatsAppCall200Response, Integer, Hash)>

Get a single call

Parameters:

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

    the optional parameters

Returns:

  • (Array<(GetWhatsAppCall200Response, Integer, Hash)>)

    GetWhatsAppCall200Response data, response status code and response headers



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
370
371
372
373
374
375
376
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 325

def get_whats_app_call_with_http_info(id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppCallingApi.get_whats_app_call ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WhatsAppCallingApi.get_whats_app_call"
  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 WhatsAppCallingApi.get_whats_app_call"
  end
  # resource path
  local_var_path = '/v1/whatsapp/calls/{id}'.sub('{' + 'id' + '}', CGI.escape(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] || 'GetWhatsAppCall200Response'

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

  new_options = opts.merge(
    :operation => :"WhatsAppCallingApi.get_whats_app_call",
    :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: WhatsAppCallingApi#get_whats_app_call\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_whats_app_calling(id, opts = {}) ⇒ GetWhatsAppCalling200Response

Get calling config for a number The WhatsApp Business Calling configuration of this number, keyed the same way as the POST/PATCH/DELETE below (full read-write on one sub-resource). Encrypted secrets are never returned; only a boolean saying whether a SIP password is stored. The account-scoped read (GET /v1/whatsapp/calling?accountId=) remains for callers that only know the social account id, and additionally carries account-level extras (billing eligibility, current-period spend).

Parameters:

  • id (String)

    Phone number record ID (from GET /v1/phone-numbers).

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

    the optional parameters

Returns:



616
617
618
619
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 616

def get_whats_app_calling(id, opts = {})
  data, _status_code, _headers = get_whats_app_calling_with_http_info(id, opts)
  data
end

#get_whats_app_calling_config(account_id, opts = {}) ⇒ GetWhatsAppCallingConfig200Response

Get calling config for an account Returns the local calling configuration snapshot for the connected WhatsApp account: whether calling is enabled, the forward-to destination URI, recording opt-in state, the phone number record id (use as {id} on the read-write calling sub-resource at /v1/phone-numbers/id/whatsapp/calling) and whether SIP digest credentials are stored (the encrypted password itself is never returned). Also carries account-level extras (billing eligibility, current-period spend) that the number-keyed GET does not.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



679
680
681
682
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 679

def get_whats_app_calling_config(, opts = {})
  data, _status_code, _headers = get_whats_app_calling_config_with_http_info(, opts)
  data
end

#get_whats_app_calling_config_with_http_info(account_id, opts = {}) ⇒ Array<(GetWhatsAppCallingConfig200Response, Integer, Hash)>

Get calling config for an account Returns the local calling configuration snapshot for the connected WhatsApp account: whether calling is enabled, the forward-to destination URI, recording opt-in state, the phone number record id (use as `id` on the read-write calling sub-resource at /v1/phone-numbers/id/whatsapp/calling) and whether SIP digest credentials are stored (the encrypted password itself is never returned). Also carries account-level extras (billing eligibility, current-period spend) that the number-keyed GET does not.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 689

def get_whats_app_calling_config_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppCallingApi.get_whats_app_calling_config ...'
  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 WhatsAppCallingApi.get_whats_app_calling_config"
  end
  # resource path
  local_var_path = '/v1/whatsapp/calling'

  # 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] || 'GetWhatsAppCallingConfig200Response'

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

  new_options = opts.merge(
    :operation => :"WhatsAppCallingApi.get_whats_app_calling_config",
    :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: WhatsAppCallingApi#get_whats_app_calling_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_whats_app_calling_with_http_info(id, opts = {}) ⇒ Array<(GetWhatsAppCalling200Response, Integer, Hash)>

Get calling config for a number The WhatsApp Business Calling configuration of this number, keyed the same way as the POST/PATCH/DELETE below (full read-write on one sub-resource). Encrypted secrets are never returned; only a boolean saying whether a SIP password is stored. The account-scoped read (`GET /v1/whatsapp/calling?accountId=`) remains for callers that only know the social account id, and additionally carries account-level extras (billing eligibility, current-period spend).

Parameters:

  • id (String)

    Phone number record ID (from GET /v1/phone-numbers).

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

    the optional parameters

Returns:



626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 626

def get_whats_app_calling_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppCallingApi.get_whats_app_calling ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WhatsAppCallingApi.get_whats_app_calling"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/{id}/whatsapp/calling'.sub('{' + 'id' + '}', CGI.escape(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] || 'GetWhatsAppCalling200Response'

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

  new_options = opts.merge(
    :operation => :"WhatsAppCallingApi.get_whats_app_calling",
    :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: WhatsAppCallingApi#get_whats_app_calling\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#initiate_whats_app_call(initiate_whats_app_call_request, opts = {}) ⇒ InitiateWhatsAppCall200Response

Initiate outbound call Initiates an outbound Business-Initiated Call. The Telnyx-side SIP leg is originated server-side (Option B: SIP-first). Telnyx INVITEs Meta directly over TLS:5061 with the SIP digest credentials we captured at calling-enablement time). No client-side SDP is required; pass only accountId and to. To send the consumer the call-consent prompt instead of placing a call, pass action: \"send_call_permission_request\" (+ optional bodyText). The consumer must tap Allow in WhatsApp before start_call is permitted; Meta limits the prompt to 1 per consumer per 24h (2 per 7 days) and requires an open 24h service window. Idempotency: send an Idempotency-Key header to make retries safe; same key + same body replays the original response instead of dialing (and billing) a second call.

Parameters:

Options Hash (opts):

  • :idempotency_key (String)

    Optional client-generated unique key (e.g. a UUID) that makes dial retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.

Returns:



744
745
746
747
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 744

def initiate_whats_app_call(initiate_whats_app_call_request, opts = {})
  data, _status_code, _headers = initiate_whats_app_call_with_http_info(initiate_whats_app_call_request, opts)
  data
end

#initiate_whats_app_call_with_http_info(initiate_whats_app_call_request, opts = {}) ⇒ Array<(InitiateWhatsAppCall200Response, Integer, Hash)>

Initiate outbound call Initiates an outbound Business-Initiated Call. The Telnyx-side SIP leg is originated server-side (Option B: SIP-first). Telnyx INVITEs Meta directly over TLS:5061 with the SIP digest credentials we captured at calling-enablement time). No client-side SDP is required; pass only `accountId` and `to`. To send the consumer the call-consent prompt instead of placing a call, pass `action: &quot;send_call_permission_request&quot;` (+ optional `bodyText`). The consumer must tap Allow in WhatsApp before `start_call` is permitted; Meta limits the prompt to 1 per consumer per 24h (2 per 7 days) and requires an open 24h service window. Idempotency: send an `Idempotency-Key` header to make retries safe; same key + same body replays the original response instead of dialing (and billing) a second call.

Parameters:

Options Hash (opts):

  • :idempotency_key (String)

    Optional client-generated unique key (e.g. a UUID) that makes dial retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.

Returns:



755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 755

def initiate_whats_app_call_with_http_info(initiate_whats_app_call_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppCallingApi.initiate_whats_app_call ...'
  end
  # verify the required parameter 'initiate_whats_app_call_request' is set
  if @api_client.config.client_side_validation && initiate_whats_app_call_request.nil?
    fail ArgumentError, "Missing the required parameter 'initiate_whats_app_call_request' when calling WhatsAppCallingApi.initiate_whats_app_call"
  end
  if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
    fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WhatsAppCallingApi.initiate_whats_app_call, the character length must be smaller than or equal to 255.'
  end

  # resource path
  local_var_path = '/v1/whatsapp/calls'

  # 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
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

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

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

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

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

  new_options = opts.merge(
    :operation => :"WhatsAppCallingApi.initiate_whats_app_call",
    :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: WhatsAppCallingApi#initiate_whats_app_call\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_whats_app_calls(account_id, opts = {}) ⇒ ListWhatsAppCalls200Response

List call history for an account Compact history listing for a single connected account. Results are scoped to the resolved SocialAccount; profile-scoped team members cannot read calls on sibling accounts. Cursor pagination: pass the returned nextCursor as before to fetch the next page (same scheme as GET /v1/calls). since/until remain as absolute range filters and combine with the cursor.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :status (String)
  • :direction (String)
  • :since (Time)
  • :_until (Time)
  • :before (Time)

    Return calls with startedAt strictly before this instant (use the previous page's nextCursor).

  • :limit (Integer)

Returns:



824
825
826
827
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 824

def list_whats_app_calls(, opts = {})
  data, _status_code, _headers = list_whats_app_calls_with_http_info(, opts)
  data
end

#list_whats_app_calls_with_http_info(account_id, opts = {}) ⇒ Array<(ListWhatsAppCalls200Response, Integer, Hash)>

List call history for an account Compact history listing for a single connected account. Results are scoped to the resolved SocialAccount; profile-scoped team members cannot read calls on sibling accounts. Cursor pagination: pass the returned `nextCursor` as `before` to fetch the next page (same scheme as `GET /v1/calls`). `since`/`until` remain as absolute range filters and combine with the cursor.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :status (String)
  • :direction (String)
  • :since (Time)
  • :_until (Time)
  • :before (Time)

    Return calls with startedAt strictly before this instant (use the previous page's nextCursor).

  • :limit (Integer)

Returns:



840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
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
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 840

def list_whats_app_calls_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppCallingApi.list_whats_app_calls ...'
  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 WhatsAppCallingApi.list_whats_app_calls"
  end
  allowable_values = ["ringing", "answered", "ended", "failed"]
  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
  allowable_values = ["inbound", "outbound"]
  if @api_client.config.client_side_validation && opts[:'direction'] && !allowable_values.include?(opts[:'direction'])
    fail ArgumentError, "invalid value for \"direction\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 200
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling WhatsAppCallingApi.list_whats_app_calls, 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 WhatsAppCallingApi.list_whats_app_calls, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/whatsapp/calls'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'until'] = opts[:'_until'] if !opts[:'_until'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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] || 'ListWhatsAppCalls200Response'

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

  new_options = opts.merge(
    :operation => :"WhatsAppCallingApi.list_whats_app_calls",
    :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: WhatsAppCallingApi#list_whats_app_calls\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_whats_app_calling(id, update_whats_app_calling_legacy_request, opts = {}) ⇒ nil

Update calling config Update fields on an already-enabled number. Only fields present in the body are written; undefined leaves the stored value alone, explicit null clears a nullable field. No Meta side effect, this only changes local routing state consumed by the Telnyx webhook handler.

Parameters:

Returns:

  • (nil)


917
918
919
920
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 917

def update_whats_app_calling(id, update_whats_app_calling_legacy_request, opts = {})
  update_whats_app_calling_with_http_info(id, update_whats_app_calling_legacy_request, opts)
  nil
end

#update_whats_app_calling_legacy(id, update_whats_app_calling_legacy_request, opts = {}) ⇒ nil

Update calling config Deprecated alias of /v1/phone-numbers/{id}/whatsapp/calling; same contract. New integrations should use that path. Update fields on an already-enabled number. Only fields present in the body are written; undefined leaves the stored value alone, explicit null clears a nullable field. No Meta side effect, this only changes local routing state consumed by the Telnyx webhook handler.

Parameters:

Returns:

  • (nil)


991
992
993
994
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 991

def update_whats_app_calling_legacy(id, update_whats_app_calling_legacy_request, opts = {})
  update_whats_app_calling_legacy_with_http_info(id, update_whats_app_calling_legacy_request, opts)
  nil
end

#update_whats_app_calling_legacy_with_http_info(id, update_whats_app_calling_legacy_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Update calling config Deprecated alias of `/v1/phone-numbers/id/whatsapp/calling`; same contract. New integrations should use that path. Update fields on an already-enabled number. Only fields present in the body are written; `undefined` leaves the stored value alone, explicit `null` clears a nullable field. No Meta side effect, this only changes local routing state consumed by the Telnyx webhook handler.

Parameters:

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



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
1050
1051
1052
1053
1054
1055
1056
1057
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 1002

def update_whats_app_calling_legacy_with_http_info(id, update_whats_app_calling_legacy_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppCallingApi.update_whats_app_calling_legacy ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WhatsAppCallingApi.update_whats_app_calling_legacy"
  end
  # verify the required parameter 'update_whats_app_calling_legacy_request' is set
  if @api_client.config.client_side_validation && update_whats_app_calling_legacy_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_whats_app_calling_legacy_request' when calling WhatsAppCallingApi.update_whats_app_calling_legacy"
  end
  # resource path
  local_var_path = '/v1/whatsapp/phone-numbers/{id}/calling'.sub('{' + 'id' + '}', CGI.escape(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_whats_app_calling_legacy_request)

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"WhatsAppCallingApi.update_whats_app_calling_legacy",
    :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: WhatsAppCallingApi#update_whats_app_calling_legacy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_whats_app_calling_with_http_info(id, update_whats_app_calling_legacy_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Update calling config Update fields on an already-enabled number. Only fields present in the body are written; `undefined` leaves the stored value alone, explicit `null` clears a nullable field. No Meta side effect, this only changes local routing state consumed by the Telnyx webhook handler.

Parameters:

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



928
929
930
931
932
933
934
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
982
983
# File 'lib/zernio-sdk/api/whats_app_calling_api.rb', line 928

def update_whats_app_calling_with_http_info(id, update_whats_app_calling_legacy_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppCallingApi.update_whats_app_calling ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WhatsAppCallingApi.update_whats_app_calling"
  end
  # verify the required parameter 'update_whats_app_calling_legacy_request' is set
  if @api_client.config.client_side_validation && update_whats_app_calling_legacy_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_whats_app_calling_legacy_request' when calling WhatsAppCallingApi.update_whats_app_calling"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/{id}/whatsapp/calling'.sub('{' + 'id' + '}', CGI.escape(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_whats_app_calling_legacy_request)

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"WhatsAppCallingApi.update_whats_app_calling",
    :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: WhatsAppCallingApi#update_whats_app_calling\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end