Class: OneMsgChatApi::FlowsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/one_msg_chat_api/api/flows_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ FlowsApi

Returns a new instance of FlowsApi.



19
20
21
# File 'lib/one_msg_chat_api/api/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/one_msg_chat_api/api/flows_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_flows(token, opts = {}) ⇒ CreateGroups200Response

Create Flow

Parameters:

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Options Hash (opts):

  • :waba_account_id (String)

Returns:



27
28
29
30
# File 'lib/one_msg_chat_api/api/flows_api.rb', line 27

def create_flows(token, opts = {})
  data, _status_code, _headers = create_flows_with_http_info(token, opts)
  data
end

#create_flows_flow_id_deprecate(flow_id, token, opts = {}) ⇒ Hash<String, Object>

Deprecate Flow

Parameters:

  • flow_id (String)

    Flow ID

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Options Hash (opts):

  • :waba_account_id (String)

Returns:

  • (Hash<String, Object>)


93
94
95
96
# File 'lib/one_msg_chat_api/api/flows_api.rb', line 93

def create_flows_flow_id_deprecate(flow_id, token, opts = {})
  data, _status_code, _headers = create_flows_flow_id_deprecate_with_http_info(flow_id, token, opts)
  data
end

#create_flows_flow_id_deprecate_with_http_info(flow_id, token, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>

Deprecate Flow

Parameters:

  • flow_id (String)

    Flow ID

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Options Hash (opts):

  • :waba_account_id (String)

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>)

    Hash<String, Object> data, response status code and response headers



104
105
106
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
# File 'lib/one_msg_chat_api/api/flows_api.rb', line 104

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'token'] = token
  query_params[:'wabaAccountId'] = opts[:'waba_account_id'] if !opts[:'waba_account_id'].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] || 'Hash<String, Object>'

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

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

#create_flows_flow_id_publish(flow_id, token, opts = {}) ⇒ Hash<String, Object>

Publish Flow

Parameters:

  • flow_id (String)

    Flow ID

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Options Hash (opts):

  • :waba_account_id (String)

Returns:

  • (Hash<String, Object>)


164
165
166
167
# File 'lib/one_msg_chat_api/api/flows_api.rb', line 164

def create_flows_flow_id_publish(flow_id, token, opts = {})
  data, _status_code, _headers = create_flows_flow_id_publish_with_http_info(flow_id, token, opts)
  data
end

#create_flows_flow_id_publish_with_http_info(flow_id, token, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>

Publish Flow

Parameters:

  • flow_id (String)

    Flow ID

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Options Hash (opts):

  • :waba_account_id (String)

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>)

    Hash<String, Object> data, response status code and response headers



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

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'token'] = token
  query_params[:'wabaAccountId'] = opts[:'waba_account_id'] if !opts[:'waba_account_id'].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] || 'Hash<String, Object>'

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

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

#create_flows_with_http_info(token, opts = {}) ⇒ Array<(CreateGroups200Response, Integer, Hash)>

Create Flow

Parameters:

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Options Hash (opts):

  • :waba_account_id (String)

Returns:

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

    CreateGroups200Response data, response status code and response headers



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
# File 'lib/one_msg_chat_api/api/flows_api.rb', line 37

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'token'] = token
  query_params[:'wabaAccountId'] = opts[:'waba_account_id'] if !opts[:'waba_account_id'].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] || 'CreateGroups200Response'

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

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

#delete_flows_flow_id(flow_id, token, opts = {}) ⇒ DeleteFlowsFlowId200Response

Delete Flow

Parameters:

  • flow_id (String)

    Flow ID

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Options Hash (opts):

  • :waba_account_id (String)

Returns:



235
236
237
238
# File 'lib/one_msg_chat_api/api/flows_api.rb', line 235

def delete_flows_flow_id(flow_id, token, opts = {})
  data, _status_code, _headers = delete_flows_flow_id_with_http_info(flow_id, token, opts)
  data
end

#delete_flows_flow_id_with_http_info(flow_id, token, opts = {}) ⇒ Array<(DeleteFlowsFlowId200Response, Integer, Hash)>

Delete Flow

Parameters:

  • flow_id (String)

    Flow ID

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Options Hash (opts):

  • :waba_account_id (String)

Returns:



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

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'token'] = token
  query_params[:'wabaAccountId'] = opts[:'waba_account_id'] if !opts[:'waba_account_id'].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] || 'DeleteFlowsFlowId200Response'

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

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

#get_flows_flow_id(flow_id, token, opts = {}) ⇒ CreateGroups200Response

Get Flow Details

Parameters:

  • flow_id (String)

    Flow ID

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Options Hash (opts):

  • :waba_account_id (String)

Returns:



306
307
308
309
# File 'lib/one_msg_chat_api/api/flows_api.rb', line 306

def get_flows_flow_id(flow_id, token, opts = {})
  data, _status_code, _headers = get_flows_flow_id_with_http_info(flow_id, token, opts)
  data
end

#get_flows_flow_id_preview(flow_id, token, opts = {}) ⇒ Hash<String, Object>

Preview Flow

Parameters:

  • flow_id (String)

    Flow ID

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Options Hash (opts):

  • :waba_account_id (String)

Returns:

  • (Hash<String, Object>)


377
378
379
380
# File 'lib/one_msg_chat_api/api/flows_api.rb', line 377

def get_flows_flow_id_preview(flow_id, token, opts = {})
  data, _status_code, _headers = get_flows_flow_id_preview_with_http_info(flow_id, token, opts)
  data
end

#get_flows_flow_id_preview_with_http_info(flow_id, token, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>

Preview Flow

Parameters:

  • flow_id (String)

    Flow ID

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Options Hash (opts):

  • :waba_account_id (String)

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>)

    Hash<String, Object> data, response status code and response headers



388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
# File 'lib/one_msg_chat_api/api/flows_api.rb', line 388

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'token'] = token
  query_params[:'wabaAccountId'] = opts[:'waba_account_id'] if !opts[:'waba_account_id'].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] || 'Hash<String, Object>'

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

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

#get_flows_flow_id_with_http_info(flow_id, token, opts = {}) ⇒ Array<(CreateGroups200Response, Integer, Hash)>

Get Flow Details

Parameters:

  • flow_id (String)

    Flow ID

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Options Hash (opts):

  • :waba_account_id (String)

Returns:

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

    CreateGroups200Response data, response status code and response headers



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

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'token'] = token
  query_params[:'wabaAccountId'] = opts[:'waba_account_id'] if !opts[:'waba_account_id'].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] || 'CreateGroups200Response'

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

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

#get_whatsapp_business_encryption(token, opts = {}) ⇒ GetWhatsappBusinessEncryption200Response

Get business encryption public key Retrieve the WhatsApp business public key and signature status for this channel's phone number. Required before publishing or sending Flows that use data encryption.

Parameters:

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Returns:



447
448
449
450
# File 'lib/one_msg_chat_api/api/flows_api.rb', line 447

def get_whatsapp_business_encryption(token, opts = {})
  data, _status_code, _headers = get_whatsapp_business_encryption_with_http_info(token, opts)
  data
end

#get_whatsapp_business_encryption_with_http_info(token, opts = {}) ⇒ Array<(GetWhatsappBusinessEncryption200Response, Integer, Hash)>

Get business encryption public key Retrieve the WhatsApp business public key and signature status for this channel's phone number. Required before publishing or sending Flows that use data encryption.

Parameters:

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Returns:



457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
# File 'lib/one_msg_chat_api/api/flows_api.rb', line 457

def get_whatsapp_business_encryption_with_http_info(token, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FlowsApi.get_whatsapp_business_encryption ...'
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling FlowsApi.get_whatsapp_business_encryption"
  end
  # resource path
  local_var_path = '/whatsapp_business_encryption'

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

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

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

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

#list_flows(token, opts = {}) ⇒ ListFlows200Response

List Flows

Parameters:

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Options Hash (opts):

  • :waba_account_id (String)

Returns:



511
512
513
514
# File 'lib/one_msg_chat_api/api/flows_api.rb', line 511

def list_flows(token, opts = {})
  data, _status_code, _headers = list_flows_with_http_info(token, opts)
  data
end

#list_flows_with_http_info(token, opts = {}) ⇒ Array<(ListFlows200Response, Integer, Hash)>

List Flows

Parameters:

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Options Hash (opts):

  • :waba_account_id (String)

Returns:

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

    ListFlows200Response data, response status code and response headers



521
522
523
524
525
526
527
528
529
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
# File 'lib/one_msg_chat_api/api/flows_api.rb', line 521

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'token'] = token
  query_params[:'wabaAccountId'] = opts[:'waba_account_id'] if !opts[:'waba_account_id'].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] || 'ListFlows200Response'

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

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

#patch_flows_flow_id_assets(flow_id, token, opts = {}) ⇒ PatchFlowsFlowIdAssets200Response

Update Flow Structure

Parameters:

  • flow_id (String)

    Flow ID

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Options Hash (opts):

  • :waba_account_id (String)

Returns:



577
578
579
580
# File 'lib/one_msg_chat_api/api/flows_api.rb', line 577

def patch_flows_flow_id_assets(flow_id, token, opts = {})
  data, _status_code, _headers = patch_flows_flow_id_assets_with_http_info(flow_id, token, opts)
  data
end

#patch_flows_flow_id_assets_with_http_info(flow_id, token, opts = {}) ⇒ Array<(PatchFlowsFlowIdAssets200Response, Integer, Hash)>

Update Flow Structure

Parameters:

  • flow_id (String)

    Flow ID

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Options Hash (opts):

  • :waba_account_id (String)

Returns:



588
589
590
591
592
593
594
595
596
597
598
599
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
# File 'lib/one_msg_chat_api/api/flows_api.rb', line 588

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'token'] = token
  query_params[:'wabaAccountId'] = opts[:'waba_account_id'] if !opts[:'waba_account_id'].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] || 'PatchFlowsFlowIdAssets200Response'

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

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

#patch_flows_flow_id_metadata(flow_id, token, opts = {}) ⇒ Hash<String, Object>

Update Flow Metadata

Parameters:

  • flow_id (String)

    Flow ID

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Options Hash (opts):

  • :waba_account_id (String)

Returns:

  • (Hash<String, Object>)


648
649
650
651
# File 'lib/one_msg_chat_api/api/flows_api.rb', line 648

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

#patch_flows_flow_id_metadata_with_http_info(flow_id, token, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>

Update Flow Metadata

Parameters:

  • flow_id (String)

    Flow ID

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Options Hash (opts):

  • :waba_account_id (String)

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>)

    Hash<String, Object> data, response status code and response headers



659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
# File 'lib/one_msg_chat_api/api/flows_api.rb', line 659

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'token'] = token
  query_params[:'wabaAccountId'] = opts[:'waba_account_id'] if !opts[:'waba_account_id'].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] || 'Hash<String, Object>'

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

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

#set_whatsapp_business_encryption(token, set_whatsapp_business_encryption_request, opts = {}) ⇒ CreateCommerce200Response

Set business encryption public key Upload and sign a 2048-bit RSA business public key (PEM) for this channel's phone number. Meta requires a signed key before Flow publish/send. Only one active key per number; a new upload replaces the previous key.

Parameters:

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Returns:



719
720
721
722
# File 'lib/one_msg_chat_api/api/flows_api.rb', line 719

def set_whatsapp_business_encryption(token, set_whatsapp_business_encryption_request, opts = {})
  data, _status_code, _headers = set_whatsapp_business_encryption_with_http_info(token, set_whatsapp_business_encryption_request, opts)
  data
end

#set_whatsapp_business_encryption_with_http_info(token, set_whatsapp_business_encryption_request, opts = {}) ⇒ Array<(CreateCommerce200Response, Integer, Hash)>

Set business encryption public key Upload and sign a 2048-bit RSA business public key (PEM) for this channel's phone number. Meta requires a signed key before Flow publish/send. Only one active key per number; a new upload replaces the previous key.

Parameters:

  • token (String)

    JWT token or API key for authorization

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

    the optional parameters

Returns:

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

    CreateCommerce200Response data, response status code and response headers



730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
# File 'lib/one_msg_chat_api/api/flows_api.rb', line 730

def set_whatsapp_business_encryption_with_http_info(token, set_whatsapp_business_encryption_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FlowsApi.set_whatsapp_business_encryption ...'
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling FlowsApi.set_whatsapp_business_encryption"
  end
  # verify the required parameter 'set_whatsapp_business_encryption_request' is set
  if @api_client.config.client_side_validation && set_whatsapp_business_encryption_request.nil?
    fail ArgumentError, "Missing the required parameter 'set_whatsapp_business_encryption_request' when calling FlowsApi.set_whatsapp_business_encryption"
  end
  # resource path
  local_var_path = '/whatsapp_business_encryption'

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

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

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

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

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

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

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