Class: Late::WhatsAppFlowsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/late-sdk/api/whats_app_flows_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ WhatsAppFlowsApi

Returns a new instance of WhatsAppFlowsApi.



19
20
21
# File 'lib/late-sdk/api/whats_app_flows_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/late-sdk/api/whats_app_flows_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_whats_app_flow(create_whats_app_flow_request, opts = {}) ⇒ CreateWhatsAppFlow200Response

Create flow Create a new WhatsApp Flow in DRAFT status. Optionally clone an existing flow. After creating, upload a Flow JSON definition, then publish to make it sendable.

Parameters:

Returns:



27
28
29
30
# File 'lib/late-sdk/api/whats_app_flows_api.rb', line 27

def create_whats_app_flow(create_whats_app_flow_request, opts = {})
  data, _status_code, _headers = create_whats_app_flow_with_http_info(create_whats_app_flow_request, opts)
  data
end

#create_whats_app_flow_with_http_info(create_whats_app_flow_request, opts = {}) ⇒ Array<(CreateWhatsAppFlow200Response, Integer, Hash)>

Create flow Create a new WhatsApp Flow in DRAFT status. Optionally clone an existing flow. After creating, upload a Flow JSON definition, then publish to make it sendable.

Parameters:

Returns:



37
38
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
# File 'lib/late-sdk/api/whats_app_flows_api.rb', line 37

def create_whats_app_flow_with_http_info(create_whats_app_flow_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppFlowsApi.create_whats_app_flow ...'
  end
  # verify the required parameter 'create_whats_app_flow_request' is set
  if @api_client.config.client_side_validation && create_whats_app_flow_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_whats_app_flow_request' when calling WhatsAppFlowsApi.create_whats_app_flow"
  end
  # resource path
  local_var_path = '/v1/whatsapp/flows'

  # 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_whats_app_flow_request)

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

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

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

#delete_whats_app_flow(flow_id, account_id, opts = {}) ⇒ UpdateYoutubeDefaultPlaylist200Response

Delete flow Delete a DRAFT flow. This is irreversible. Only flows in DRAFT status can be deleted.

Parameters:

  • flow_id (String)

    Flow ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



96
97
98
99
# File 'lib/late-sdk/api/whats_app_flows_api.rb', line 96

def delete_whats_app_flow(flow_id, , opts = {})
  data, _status_code, _headers = delete_whats_app_flow_with_http_info(flow_id, , opts)
  data
end

#delete_whats_app_flow_with_http_info(flow_id, account_id, opts = {}) ⇒ Array<(UpdateYoutubeDefaultPlaylist200Response, Integer, Hash)>

Delete flow Delete a DRAFT flow. This is irreversible. Only flows in DRAFT status can be deleted.

Parameters:

  • flow_id (String)

    Flow ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



107
108
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
# File 'lib/late-sdk/api/whats_app_flows_api.rb', line 107

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

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

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

#deprecate_whats_app_flow(flow_id, publish_whats_app_flow_request, opts = {}) ⇒ UpdateYoutubeDefaultPlaylist200Response

Deprecate flow Deprecate a PUBLISHED flow. **This is irreversible.** Deprecated flows cannot be sent or opened, but existing active sessions may continue until they complete.

Parameters:

  • flow_id (String)

    Flow ID

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

    the optional parameters

Returns:



166
167
168
169
# File 'lib/late-sdk/api/whats_app_flows_api.rb', line 166

def deprecate_whats_app_flow(flow_id, publish_whats_app_flow_request, opts = {})
  data, _status_code, _headers = deprecate_whats_app_flow_with_http_info(flow_id, publish_whats_app_flow_request, opts)
  data
end

#deprecate_whats_app_flow_with_http_info(flow_id, publish_whats_app_flow_request, opts = {}) ⇒ Array<(UpdateYoutubeDefaultPlaylist200Response, Integer, Hash)>

Deprecate flow Deprecate a PUBLISHED flow. **This is irreversible.** Deprecated flows cannot be sent or opened, but existing active sessions may continue until they complete.

Parameters:

  • flow_id (String)

    Flow ID

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

    the optional parameters

Returns:



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
226
227
228
229
230
231
232
# File 'lib/late-sdk/api/whats_app_flows_api.rb', line 177

def deprecate_whats_app_flow_with_http_info(flow_id, publish_whats_app_flow_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppFlowsApi.deprecate_whats_app_flow ...'
  end
  # verify the required parameter 'flow_id' is set
  if @api_client.config.client_side_validation && flow_id.nil?
    fail ArgumentError, "Missing the required parameter 'flow_id' when calling WhatsAppFlowsApi.deprecate_whats_app_flow"
  end
  # verify the required parameter 'publish_whats_app_flow_request' is set
  if @api_client.config.client_side_validation && publish_whats_app_flow_request.nil?
    fail ArgumentError, "Missing the required parameter 'publish_whats_app_flow_request' when calling WhatsAppFlowsApi.deprecate_whats_app_flow"
  end
  # resource path
  local_var_path = '/v1/whatsapp/flows/{flowId}/deprecate'.sub('{' + 'flowId' + '}', CGI.escape(flow_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(publish_whats_app_flow_request)

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

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

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

#get_whats_app_flow(flow_id, account_id, opts = {}) ⇒ GetWhatsAppFlow200Response

Get flow Get details for a specific flow, including status, categories, validation errors, and preview URL.

Parameters:

  • flow_id (String)

    Flow ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Comma-separated fields to return (default: id,name,status,categories,validation_errors,json_version,preview,data_api_version,endpoint_uri)

Returns:



241
242
243
244
# File 'lib/late-sdk/api/whats_app_flows_api.rb', line 241

def get_whats_app_flow(flow_id, , opts = {})
  data, _status_code, _headers = get_whats_app_flow_with_http_info(flow_id, , opts)
  data
end

#get_whats_app_flow_json(flow_id, account_id, opts = {}) ⇒ GetWhatsAppFlowJson200Response

Get flow JSON asset Get the flow JSON asset metadata, including a temporary download URL for the Flow JSON file.

Parameters:

  • flow_id (String)

    Flow ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



313
314
315
316
# File 'lib/late-sdk/api/whats_app_flows_api.rb', line 313

def get_whats_app_flow_json(flow_id, , opts = {})
  data, _status_code, _headers = get_whats_app_flow_json_with_http_info(flow_id, , opts)
  data
end

#get_whats_app_flow_json_with_http_info(flow_id, account_id, opts = {}) ⇒ Array<(GetWhatsAppFlowJson200Response, Integer, Hash)>

Get flow JSON asset Get the flow JSON asset metadata, including a temporary download URL for the Flow JSON file.

Parameters:

  • flow_id (String)

    Flow ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



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
370
371
372
373
374
375
# File 'lib/late-sdk/api/whats_app_flows_api.rb', line 324

def get_whats_app_flow_json_with_http_info(flow_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppFlowsApi.get_whats_app_flow_json ...'
  end
  # verify the required parameter 'flow_id' is set
  if @api_client.config.client_side_validation && flow_id.nil?
    fail ArgumentError, "Missing the required parameter 'flow_id' when calling WhatsAppFlowsApi.get_whats_app_flow_json"
  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 WhatsAppFlowsApi.get_whats_app_flow_json"
  end
  # resource path
  local_var_path = '/v1/whatsapp/flows/{flowId}/json'.sub('{' + 'flowId' + '}', CGI.escape(flow_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] || 'GetWhatsAppFlowJson200Response'

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

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

#get_whats_app_flow_with_http_info(flow_id, account_id, opts = {}) ⇒ Array<(GetWhatsAppFlow200Response, Integer, Hash)>

Get flow Get details for a specific flow, including status, categories, validation errors, and preview URL.

Parameters:

  • flow_id (String)

    Flow ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Comma-separated fields to return (default: id,name,status,categories,validation_errors,json_version,preview,data_api_version,endpoint_uri)

Returns:

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

    GetWhatsAppFlow200Response data, response status code and response headers



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
# File 'lib/late-sdk/api/whats_app_flows_api.rb', line 253

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

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

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

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

#list_whats_app_flows(account_id, opts = {}) ⇒ ListWhatsAppFlows200Response

List flows List all WhatsApp Flows for the Business Account (WABA) associated with the given account.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



382
383
384
385
# File 'lib/late-sdk/api/whats_app_flows_api.rb', line 382

def list_whats_app_flows(, opts = {})
  data, _status_code, _headers = list_whats_app_flows_with_http_info(, opts)
  data
end

#list_whats_app_flows_with_http_info(account_id, opts = {}) ⇒ Array<(ListWhatsAppFlows200Response, Integer, Hash)>

List flows List all WhatsApp Flows for the Business Account (WABA) associated with the given account.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



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
433
434
435
436
437
438
439
# File 'lib/late-sdk/api/whats_app_flows_api.rb', line 392

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

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

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

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

#publish_whats_app_flow(flow_id, publish_whats_app_flow_request, opts = {}) ⇒ UpdateYoutubeDefaultPlaylist200Response

Publish flow Publish a DRAFT flow. **This is irreversible.** Once published, the flow and its JSON become immutable and the flow can be sent to users. To update a published flow, create a new flow (optionally cloning this one via ‘cloneFlowId`).

Parameters:

  • flow_id (String)

    Flow ID

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

    the optional parameters

Returns:



447
448
449
450
# File 'lib/late-sdk/api/whats_app_flows_api.rb', line 447

def publish_whats_app_flow(flow_id, publish_whats_app_flow_request, opts = {})
  data, _status_code, _headers = publish_whats_app_flow_with_http_info(flow_id, publish_whats_app_flow_request, opts)
  data
end

#publish_whats_app_flow_with_http_info(flow_id, publish_whats_app_flow_request, opts = {}) ⇒ Array<(UpdateYoutubeDefaultPlaylist200Response, Integer, Hash)>

Publish flow Publish a DRAFT flow. **This is irreversible.** Once published, the flow and its JSON become immutable and the flow can be sent to users. To update a published flow, create a new flow (optionally cloning this one via &#x60;cloneFlowId&#x60;).

Parameters:

  • flow_id (String)

    Flow ID

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

    the optional parameters

Returns:



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
# File 'lib/late-sdk/api/whats_app_flows_api.rb', line 458

def publish_whats_app_flow_with_http_info(flow_id, publish_whats_app_flow_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppFlowsApi.publish_whats_app_flow ...'
  end
  # verify the required parameter 'flow_id' is set
  if @api_client.config.client_side_validation && flow_id.nil?
    fail ArgumentError, "Missing the required parameter 'flow_id' when calling WhatsAppFlowsApi.publish_whats_app_flow"
  end
  # verify the required parameter 'publish_whats_app_flow_request' is set
  if @api_client.config.client_side_validation && publish_whats_app_flow_request.nil?
    fail ArgumentError, "Missing the required parameter 'publish_whats_app_flow_request' when calling WhatsAppFlowsApi.publish_whats_app_flow"
  end
  # resource path
  local_var_path = '/v1/whatsapp/flows/{flowId}/publish'.sub('{' + 'flowId' + '}', CGI.escape(flow_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(publish_whats_app_flow_request)

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

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

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

#send_whats_app_flow_message(send_whats_app_flow_message_request, opts = {}) ⇒ SendWhatsAppFlowMessage200Response

Send flow message Send a published flow as an interactive message with a CTA button. When the recipient taps the button, the flow opens natively in WhatsApp. Flow responses are received via webhooks.

Parameters:

Returns:



520
521
522
523
# File 'lib/late-sdk/api/whats_app_flows_api.rb', line 520

def send_whats_app_flow_message(send_whats_app_flow_message_request, opts = {})
  data, _status_code, _headers = send_whats_app_flow_message_with_http_info(send_whats_app_flow_message_request, opts)
  data
end

#send_whats_app_flow_message_with_http_info(send_whats_app_flow_message_request, opts = {}) ⇒ Array<(SendWhatsAppFlowMessage200Response, Integer, Hash)>

Send flow message Send a published flow as an interactive message with a CTA button. When the recipient taps the button, the flow opens natively in WhatsApp. Flow responses are received via webhooks.

Parameters:

Returns:



530
531
532
533
534
535
536
537
538
539
540
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
# File 'lib/late-sdk/api/whats_app_flows_api.rb', line 530

def send_whats_app_flow_message_with_http_info(send_whats_app_flow_message_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppFlowsApi.send_whats_app_flow_message ...'
  end
  # verify the required parameter 'send_whats_app_flow_message_request' is set
  if @api_client.config.client_side_validation && send_whats_app_flow_message_request.nil?
    fail ArgumentError, "Missing the required parameter 'send_whats_app_flow_message_request' when calling WhatsAppFlowsApi.send_whats_app_flow_message"
  end
  # resource path
  local_var_path = '/v1/whatsapp/flows/send'

  # 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(send_whats_app_flow_message_request)

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

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

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

#update_whats_app_flow(flow_id, update_whats_app_flow_request, opts = {}) ⇒ UpdateYoutubeDefaultPlaylist200Response

Update flow Update metadata (name, categories) of a DRAFT flow. Published flows are immutable.

Parameters:

  • flow_id (String)

    Flow ID

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

    the optional parameters

Returns:



589
590
591
592
# File 'lib/late-sdk/api/whats_app_flows_api.rb', line 589

def update_whats_app_flow(flow_id, update_whats_app_flow_request, opts = {})
  data, _status_code, _headers = update_whats_app_flow_with_http_info(flow_id, update_whats_app_flow_request, opts)
  data
end

#update_whats_app_flow_with_http_info(flow_id, update_whats_app_flow_request, opts = {}) ⇒ Array<(UpdateYoutubeDefaultPlaylist200Response, Integer, Hash)>

Update flow Update metadata (name, categories) of a DRAFT flow. Published flows are immutable.

Parameters:

  • flow_id (String)

    Flow ID

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

    the optional parameters

Returns:



600
601
602
603
604
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
649
650
651
652
653
654
655
# File 'lib/late-sdk/api/whats_app_flows_api.rb', line 600

def update_whats_app_flow_with_http_info(flow_id, update_whats_app_flow_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppFlowsApi.update_whats_app_flow ...'
  end
  # verify the required parameter 'flow_id' is set
  if @api_client.config.client_side_validation && flow_id.nil?
    fail ArgumentError, "Missing the required parameter 'flow_id' when calling WhatsAppFlowsApi.update_whats_app_flow"
  end
  # verify the required parameter 'update_whats_app_flow_request' is set
  if @api_client.config.client_side_validation && update_whats_app_flow_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_whats_app_flow_request' when calling WhatsAppFlowsApi.update_whats_app_flow"
  end
  # resource path
  local_var_path = '/v1/whatsapp/flows/{flowId}'.sub('{' + 'flowId' + '}', CGI.escape(flow_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_flow_request)

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

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

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

#upload_whats_app_flow_json(flow_id, upload_whats_app_flow_json_request, opts = {}) ⇒ UploadWhatsAppFlowJson200Response

Upload flow JSON Upload or update the Flow JSON for a DRAFT flow. The Flow JSON defines all screens, components (text inputs, dropdowns, date pickers, etc.), and navigation. Meta validates the JSON on upload and returns any validation errors. See: developers.facebook.com/docs/whatsapp/flows/reference/flowjson

Parameters:

  • flow_id (String)

    Flow ID

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

    the optional parameters

Returns:



663
664
665
666
# File 'lib/late-sdk/api/whats_app_flows_api.rb', line 663

def upload_whats_app_flow_json(flow_id, upload_whats_app_flow_json_request, opts = {})
  data, _status_code, _headers = upload_whats_app_flow_json_with_http_info(flow_id, upload_whats_app_flow_json_request, opts)
  data
end

#upload_whats_app_flow_json_with_http_info(flow_id, upload_whats_app_flow_json_request, opts = {}) ⇒ Array<(UploadWhatsAppFlowJson200Response, Integer, Hash)>

Upload flow JSON Upload or update the Flow JSON for a DRAFT flow. The Flow JSON defines all screens, components (text inputs, dropdowns, date pickers, etc.), and navigation. Meta validates the JSON on upload and returns any validation errors. See: developers.facebook.com/docs/whatsapp/flows/reference/flowjson

Parameters:

  • flow_id (String)

    Flow ID

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

    the optional parameters

Returns:



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
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
# File 'lib/late-sdk/api/whats_app_flows_api.rb', line 674

def upload_whats_app_flow_json_with_http_info(flow_id, upload_whats_app_flow_json_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppFlowsApi.upload_whats_app_flow_json ...'
  end
  # verify the required parameter 'flow_id' is set
  if @api_client.config.client_side_validation && flow_id.nil?
    fail ArgumentError, "Missing the required parameter 'flow_id' when calling WhatsAppFlowsApi.upload_whats_app_flow_json"
  end
  # verify the required parameter 'upload_whats_app_flow_json_request' is set
  if @api_client.config.client_side_validation && upload_whats_app_flow_json_request.nil?
    fail ArgumentError, "Missing the required parameter 'upload_whats_app_flow_json_request' when calling WhatsAppFlowsApi.upload_whats_app_flow_json"
  end
  # resource path
  local_var_path = '/v1/whatsapp/flows/{flowId}/json'.sub('{' + 'flowId' + '}', CGI.escape(flow_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(upload_whats_app_flow_json_request)

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

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

  new_options = opts.merge(
    :operation => :"WhatsAppFlowsApi.upload_whats_app_flow_json",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WhatsAppFlowsApi#upload_whats_app_flow_json\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end