late-sdk 0.0.108 → 0.0.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +36 -0
- data/docs/AnalyticsApi.md +78 -0
- data/docs/CreateWhatsAppFlow200Response.md +20 -0
- data/docs/CreateWhatsAppFlow200ResponseFlow.md +24 -0
- data/docs/CreateWhatsAppFlowRequest.md +24 -0
- data/docs/GetWhatsAppFlow200Response.md +20 -0
- data/docs/GetWhatsAppFlow200ResponseFlow.md +30 -0
- data/docs/GetWhatsAppFlow200ResponseFlowPreview.md +20 -0
- data/docs/GetWhatsAppFlowJson200Response.md +20 -0
- data/docs/GetWhatsAppFlowJson200ResponseAssetsInner.md +22 -0
- data/docs/GetYouTubeDemographics412Response.md +24 -0
- data/docs/GetYouTubeDemographics412ResponseScopeStatus.md +22 -0
- data/docs/ListWhatsAppFlows200Response.md +20 -0
- data/docs/ListWhatsAppFlows200ResponseFlowsInner.md +26 -0
- data/docs/PublishWhatsAppFlowRequest.md +18 -0
- data/docs/SendWhatsAppFlowMessage200Response.md +20 -0
- data/docs/SendWhatsAppFlowMessageRequest.md +38 -0
- data/docs/SendWhatsAppFlowMessageRequestFlowActionPayload.md +20 -0
- data/docs/SendWhatsAppFlowMessageRequestHeader.md +20 -0
- data/docs/UpdateWhatsAppFlowRequest.md +22 -0
- data/docs/UploadWhatsAppFlowJson200Response.md +20 -0
- data/docs/UploadWhatsAppFlowJson200ResponseValidationErrorsInner.md +30 -0
- data/docs/UploadWhatsAppFlowJsonRequest.md +20 -0
- data/docs/UploadWhatsAppFlowJsonRequestFlowJson.md +49 -0
- data/docs/WhatsAppFlowsApi.md +725 -0
- data/docs/YouTubeDemographicsResponse.md +28 -0
- data/docs/YouTubeDemographicsResponseDateRange.md +20 -0
- data/docs/YouTubeDemographicsResponseDemographicsValueInner.md +20 -0
- data/lib/late-sdk/api/analytics_api.rb +73 -0
- data/lib/late-sdk/api/whats_app_flows_api.rb +731 -0
- data/lib/late-sdk/models/create_whats_app_flow200_response.rb +156 -0
- data/lib/late-sdk/models/create_whats_app_flow200_response_flow.rb +176 -0
- data/lib/late-sdk/models/create_whats_app_flow_request.rb +257 -0
- data/lib/late-sdk/models/get_whats_app_flow200_response.rb +156 -0
- data/lib/late-sdk/models/get_whats_app_flow200_response_flow.rb +205 -0
- data/lib/late-sdk/models/get_whats_app_flow200_response_flow_preview.rb +156 -0
- data/lib/late-sdk/models/get_whats_app_flow_json200_response.rb +158 -0
- data/lib/late-sdk/models/get_whats_app_flow_json200_response_assets_inner.rb +166 -0
- data/lib/late-sdk/models/get_you_tube_demographics412_response.rb +174 -0
- data/lib/late-sdk/models/get_you_tube_demographics412_response_scope_status.rb +165 -0
- data/lib/late-sdk/models/list_whats_app_flows200_response.rb +158 -0
- data/lib/late-sdk/models/list_whats_app_flows200_response_flows_inner.rb +221 -0
- data/lib/late-sdk/models/publish_whats_app_flow_request.rb +165 -0
- data/lib/late-sdk/models/send_whats_app_flow_message200_response.rb +157 -0
- data/lib/late-sdk/models/send_whats_app_flow_message_request.rb +395 -0
- data/lib/late-sdk/models/send_whats_app_flow_message_request_flow_action_payload.rb +158 -0
- data/lib/late-sdk/models/send_whats_app_flow_message_request_header.rb +190 -0
- data/lib/late-sdk/models/update_whats_app_flow_request.rb +232 -0
- data/lib/late-sdk/models/upload_whats_app_flow_json200_response.rb +159 -0
- data/lib/late-sdk/models/upload_whats_app_flow_json200_response_validation_errors_inner.rb +201 -0
- data/lib/late-sdk/models/upload_whats_app_flow_json_request.rb +191 -0
- data/lib/late-sdk/models/upload_whats_app_flow_json_request_flow_json.rb +105 -0
- data/lib/late-sdk/models/you_tube_demographics_response.rb +196 -0
- data/lib/late-sdk/models/you_tube_demographics_response_date_range.rb +156 -0
- data/lib/late-sdk/models/you_tube_demographics_response_demographics_value_inner.rb +158 -0
- data/lib/late-sdk/version.rb +1 -1
- data/lib/late-sdk.rb +26 -0
- data/openapi.yaml +616 -1
- data/spec/api/analytics_api_spec.rb +15 -0
- data/spec/api/whats_app_flows_api_spec.rb +163 -0
- data/spec/models/create_whats_app_flow200_response_flow_spec.rb +54 -0
- data/spec/models/create_whats_app_flow200_response_spec.rb +42 -0
- data/spec/models/create_whats_app_flow_request_spec.rb +58 -0
- data/spec/models/get_whats_app_flow200_response_flow_preview_spec.rb +42 -0
- data/spec/models/get_whats_app_flow200_response_flow_spec.rb +72 -0
- data/spec/models/get_whats_app_flow200_response_spec.rb +42 -0
- data/spec/models/get_whats_app_flow_json200_response_assets_inner_spec.rb +48 -0
- data/spec/models/get_whats_app_flow_json200_response_spec.rb +42 -0
- data/spec/models/get_you_tube_demographics412_response_scope_status_spec.rb +48 -0
- data/spec/models/get_you_tube_demographics412_response_spec.rb +54 -0
- data/spec/models/list_whats_app_flows200_response_flows_inner_spec.rb +64 -0
- data/spec/models/list_whats_app_flows200_response_spec.rb +42 -0
- data/spec/models/publish_whats_app_flow_request_spec.rb +36 -0
- data/spec/models/send_whats_app_flow_message200_response_spec.rb +42 -0
- data/spec/models/send_whats_app_flow_message_request_flow_action_payload_spec.rb +42 -0
- data/spec/models/send_whats_app_flow_message_request_header_spec.rb +46 -0
- data/spec/models/send_whats_app_flow_message_request_spec.rb +100 -0
- data/spec/models/update_whats_app_flow_request_spec.rb +52 -0
- data/spec/models/upload_whats_app_flow_json200_response_spec.rb +42 -0
- data/spec/models/upload_whats_app_flow_json200_response_validation_errors_inner_spec.rb +72 -0
- data/spec/models/upload_whats_app_flow_json_request_flow_json_spec.rb +32 -0
- data/spec/models/upload_whats_app_flow_json_request_spec.rb +42 -0
- data/spec/models/you_tube_demographics_response_date_range_spec.rb +42 -0
- data/spec/models/you_tube_demographics_response_demographics_value_inner_spec.rb +42 -0
- data/spec/models/you_tube_demographics_response_spec.rb +66 -0
- data/zernio-sdk-0.0.110.gem +0 -0
- metadata +107 -3
- data/zernio-sdk-0.0.108.gem +0 -0
|
@@ -0,0 +1,731 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.1
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Late
|
|
16
|
+
class WhatsAppFlowsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create flow
|
|
23
|
+
# 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.
|
|
24
|
+
# @param create_whats_app_flow_request [CreateWhatsAppFlowRequest]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [CreateWhatsAppFlow200Response]
|
|
27
|
+
def create_whats_app_flow(create_whats_app_flow_request, opts = {})
|
|
28
|
+
data, _status_code, _headers = create_whats_app_flow_with_http_info(create_whats_app_flow_request, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Create flow
|
|
33
|
+
# 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.
|
|
34
|
+
# @param create_whats_app_flow_request [CreateWhatsAppFlowRequest]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(CreateWhatsAppFlow200Response, Integer, Hash)>] CreateWhatsAppFlow200Response data, response status code and response headers
|
|
37
|
+
def create_whats_app_flow_with_http_info(create_whats_app_flow_request, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: WhatsAppFlowsApi.create_whats_app_flow ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'create_whats_app_flow_request' is set
|
|
42
|
+
if @api_client.config.client_side_validation && create_whats_app_flow_request.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'create_whats_app_flow_request' when calling WhatsAppFlowsApi.create_whats_app_flow"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/v1/whatsapp/flows'
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
# HTTP header 'Content-Type'
|
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
57
|
+
if !content_type.nil?
|
|
58
|
+
header_params['Content-Type'] = content_type
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# form parameters
|
|
62
|
+
form_params = opts[:form_params] || {}
|
|
63
|
+
|
|
64
|
+
# http body (model)
|
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_whats_app_flow_request)
|
|
66
|
+
|
|
67
|
+
# return_type
|
|
68
|
+
return_type = opts[:debug_return_type] || 'CreateWhatsAppFlow200Response'
|
|
69
|
+
|
|
70
|
+
# auth_names
|
|
71
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
72
|
+
|
|
73
|
+
new_options = opts.merge(
|
|
74
|
+
:operation => :"WhatsAppFlowsApi.create_whats_app_flow",
|
|
75
|
+
:header_params => header_params,
|
|
76
|
+
:query_params => query_params,
|
|
77
|
+
:form_params => form_params,
|
|
78
|
+
:body => post_body,
|
|
79
|
+
:auth_names => auth_names,
|
|
80
|
+
:return_type => return_type
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
84
|
+
if @api_client.config.debugging
|
|
85
|
+
@api_client.config.logger.debug "API called: WhatsAppFlowsApi#create_whats_app_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
86
|
+
end
|
|
87
|
+
return data, status_code, headers
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Delete flow
|
|
91
|
+
# Delete a DRAFT flow. This is irreversible. Only flows in DRAFT status can be deleted.
|
|
92
|
+
# @param flow_id [String] Flow ID
|
|
93
|
+
# @param account_id [String] WhatsApp social account ID
|
|
94
|
+
# @param [Hash] opts the optional parameters
|
|
95
|
+
# @return [UpdateYoutubeDefaultPlaylist200Response]
|
|
96
|
+
def delete_whats_app_flow(flow_id, account_id, opts = {})
|
|
97
|
+
data, _status_code, _headers = delete_whats_app_flow_with_http_info(flow_id, account_id, opts)
|
|
98
|
+
data
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Delete flow
|
|
102
|
+
# Delete a DRAFT flow. This is irreversible. Only flows in DRAFT status can be deleted.
|
|
103
|
+
# @param flow_id [String] Flow ID
|
|
104
|
+
# @param account_id [String] WhatsApp social account ID
|
|
105
|
+
# @param [Hash] opts the optional parameters
|
|
106
|
+
# @return [Array<(UpdateYoutubeDefaultPlaylist200Response, Integer, Hash)>] UpdateYoutubeDefaultPlaylist200Response data, response status code and response headers
|
|
107
|
+
def delete_whats_app_flow_with_http_info(flow_id, account_id, opts = {})
|
|
108
|
+
if @api_client.config.debugging
|
|
109
|
+
@api_client.config.logger.debug 'Calling API: WhatsAppFlowsApi.delete_whats_app_flow ...'
|
|
110
|
+
end
|
|
111
|
+
# verify the required parameter 'flow_id' is set
|
|
112
|
+
if @api_client.config.client_side_validation && flow_id.nil?
|
|
113
|
+
fail ArgumentError, "Missing the required parameter 'flow_id' when calling WhatsAppFlowsApi.delete_whats_app_flow"
|
|
114
|
+
end
|
|
115
|
+
# verify the required parameter 'account_id' is set
|
|
116
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
117
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling WhatsAppFlowsApi.delete_whats_app_flow"
|
|
118
|
+
end
|
|
119
|
+
# resource path
|
|
120
|
+
local_var_path = '/v1/whatsapp/flows/{flowId}'.sub('{' + 'flowId' + '}', CGI.escape(flow_id.to_s))
|
|
121
|
+
|
|
122
|
+
# query parameters
|
|
123
|
+
query_params = opts[:query_params] || {}
|
|
124
|
+
query_params[:'accountId'] = account_id
|
|
125
|
+
|
|
126
|
+
# header parameters
|
|
127
|
+
header_params = opts[:header_params] || {}
|
|
128
|
+
# HTTP header 'Accept' (if needed)
|
|
129
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
130
|
+
|
|
131
|
+
# form parameters
|
|
132
|
+
form_params = opts[:form_params] || {}
|
|
133
|
+
|
|
134
|
+
# http body (model)
|
|
135
|
+
post_body = opts[:debug_body]
|
|
136
|
+
|
|
137
|
+
# return_type
|
|
138
|
+
return_type = opts[:debug_return_type] || 'UpdateYoutubeDefaultPlaylist200Response'
|
|
139
|
+
|
|
140
|
+
# auth_names
|
|
141
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
142
|
+
|
|
143
|
+
new_options = opts.merge(
|
|
144
|
+
:operation => :"WhatsAppFlowsApi.delete_whats_app_flow",
|
|
145
|
+
:header_params => header_params,
|
|
146
|
+
:query_params => query_params,
|
|
147
|
+
:form_params => form_params,
|
|
148
|
+
:body => post_body,
|
|
149
|
+
:auth_names => auth_names,
|
|
150
|
+
:return_type => return_type
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
154
|
+
if @api_client.config.debugging
|
|
155
|
+
@api_client.config.logger.debug "API called: WhatsAppFlowsApi#delete_whats_app_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
156
|
+
end
|
|
157
|
+
return data, status_code, headers
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Deprecate flow
|
|
161
|
+
# Deprecate a PUBLISHED flow. **This is irreversible.** Deprecated flows cannot be sent or opened, but existing active sessions may continue until they complete.
|
|
162
|
+
# @param flow_id [String] Flow ID
|
|
163
|
+
# @param publish_whats_app_flow_request [PublishWhatsAppFlowRequest]
|
|
164
|
+
# @param [Hash] opts the optional parameters
|
|
165
|
+
# @return [UpdateYoutubeDefaultPlaylist200Response]
|
|
166
|
+
def deprecate_whats_app_flow(flow_id, publish_whats_app_flow_request, opts = {})
|
|
167
|
+
data, _status_code, _headers = deprecate_whats_app_flow_with_http_info(flow_id, publish_whats_app_flow_request, opts)
|
|
168
|
+
data
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Deprecate flow
|
|
172
|
+
# Deprecate a PUBLISHED flow. **This is irreversible.** Deprecated flows cannot be sent or opened, but existing active sessions may continue until they complete.
|
|
173
|
+
# @param flow_id [String] Flow ID
|
|
174
|
+
# @param publish_whats_app_flow_request [PublishWhatsAppFlowRequest]
|
|
175
|
+
# @param [Hash] opts the optional parameters
|
|
176
|
+
# @return [Array<(UpdateYoutubeDefaultPlaylist200Response, Integer, Hash)>] UpdateYoutubeDefaultPlaylist200Response data, response status code and response headers
|
|
177
|
+
def deprecate_whats_app_flow_with_http_info(flow_id, publish_whats_app_flow_request, opts = {})
|
|
178
|
+
if @api_client.config.debugging
|
|
179
|
+
@api_client.config.logger.debug 'Calling API: WhatsAppFlowsApi.deprecate_whats_app_flow ...'
|
|
180
|
+
end
|
|
181
|
+
# verify the required parameter 'flow_id' is set
|
|
182
|
+
if @api_client.config.client_side_validation && flow_id.nil?
|
|
183
|
+
fail ArgumentError, "Missing the required parameter 'flow_id' when calling WhatsAppFlowsApi.deprecate_whats_app_flow"
|
|
184
|
+
end
|
|
185
|
+
# verify the required parameter 'publish_whats_app_flow_request' is set
|
|
186
|
+
if @api_client.config.client_side_validation && publish_whats_app_flow_request.nil?
|
|
187
|
+
fail ArgumentError, "Missing the required parameter 'publish_whats_app_flow_request' when calling WhatsAppFlowsApi.deprecate_whats_app_flow"
|
|
188
|
+
end
|
|
189
|
+
# resource path
|
|
190
|
+
local_var_path = '/v1/whatsapp/flows/{flowId}/deprecate'.sub('{' + 'flowId' + '}', CGI.escape(flow_id.to_s))
|
|
191
|
+
|
|
192
|
+
# query parameters
|
|
193
|
+
query_params = opts[:query_params] || {}
|
|
194
|
+
|
|
195
|
+
# header parameters
|
|
196
|
+
header_params = opts[:header_params] || {}
|
|
197
|
+
# HTTP header 'Accept' (if needed)
|
|
198
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
199
|
+
# HTTP header 'Content-Type'
|
|
200
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
201
|
+
if !content_type.nil?
|
|
202
|
+
header_params['Content-Type'] = content_type
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# form parameters
|
|
206
|
+
form_params = opts[:form_params] || {}
|
|
207
|
+
|
|
208
|
+
# http body (model)
|
|
209
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(publish_whats_app_flow_request)
|
|
210
|
+
|
|
211
|
+
# return_type
|
|
212
|
+
return_type = opts[:debug_return_type] || 'UpdateYoutubeDefaultPlaylist200Response'
|
|
213
|
+
|
|
214
|
+
# auth_names
|
|
215
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
216
|
+
|
|
217
|
+
new_options = opts.merge(
|
|
218
|
+
:operation => :"WhatsAppFlowsApi.deprecate_whats_app_flow",
|
|
219
|
+
:header_params => header_params,
|
|
220
|
+
:query_params => query_params,
|
|
221
|
+
:form_params => form_params,
|
|
222
|
+
:body => post_body,
|
|
223
|
+
:auth_names => auth_names,
|
|
224
|
+
:return_type => return_type
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
228
|
+
if @api_client.config.debugging
|
|
229
|
+
@api_client.config.logger.debug "API called: WhatsAppFlowsApi#deprecate_whats_app_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
230
|
+
end
|
|
231
|
+
return data, status_code, headers
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# Get flow
|
|
235
|
+
# Get details for a specific flow, including status, categories, validation errors, and preview URL.
|
|
236
|
+
# @param flow_id [String] Flow ID
|
|
237
|
+
# @param account_id [String] WhatsApp social account ID
|
|
238
|
+
# @param [Hash] opts the optional parameters
|
|
239
|
+
# @option opts [String] :fields Comma-separated fields to return (default: id,name,status,categories,validation_errors,json_version,preview,data_api_version,endpoint_uri)
|
|
240
|
+
# @return [GetWhatsAppFlow200Response]
|
|
241
|
+
def get_whats_app_flow(flow_id, account_id, opts = {})
|
|
242
|
+
data, _status_code, _headers = get_whats_app_flow_with_http_info(flow_id, account_id, opts)
|
|
243
|
+
data
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# Get flow
|
|
247
|
+
# Get details for a specific flow, including status, categories, validation errors, and preview URL.
|
|
248
|
+
# @param flow_id [String] Flow ID
|
|
249
|
+
# @param account_id [String] WhatsApp social account ID
|
|
250
|
+
# @param [Hash] opts the optional parameters
|
|
251
|
+
# @option opts [String] :fields Comma-separated fields to return (default: id,name,status,categories,validation_errors,json_version,preview,data_api_version,endpoint_uri)
|
|
252
|
+
# @return [Array<(GetWhatsAppFlow200Response, Integer, Hash)>] GetWhatsAppFlow200Response data, response status code and response headers
|
|
253
|
+
def get_whats_app_flow_with_http_info(flow_id, account_id, opts = {})
|
|
254
|
+
if @api_client.config.debugging
|
|
255
|
+
@api_client.config.logger.debug 'Calling API: WhatsAppFlowsApi.get_whats_app_flow ...'
|
|
256
|
+
end
|
|
257
|
+
# verify the required parameter 'flow_id' is set
|
|
258
|
+
if @api_client.config.client_side_validation && flow_id.nil?
|
|
259
|
+
fail ArgumentError, "Missing the required parameter 'flow_id' when calling WhatsAppFlowsApi.get_whats_app_flow"
|
|
260
|
+
end
|
|
261
|
+
# verify the required parameter 'account_id' is set
|
|
262
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
263
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling WhatsAppFlowsApi.get_whats_app_flow"
|
|
264
|
+
end
|
|
265
|
+
# resource path
|
|
266
|
+
local_var_path = '/v1/whatsapp/flows/{flowId}'.sub('{' + 'flowId' + '}', CGI.escape(flow_id.to_s))
|
|
267
|
+
|
|
268
|
+
# query parameters
|
|
269
|
+
query_params = opts[:query_params] || {}
|
|
270
|
+
query_params[:'accountId'] = account_id
|
|
271
|
+
query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
|
|
272
|
+
|
|
273
|
+
# header parameters
|
|
274
|
+
header_params = opts[:header_params] || {}
|
|
275
|
+
# HTTP header 'Accept' (if needed)
|
|
276
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
277
|
+
|
|
278
|
+
# form parameters
|
|
279
|
+
form_params = opts[:form_params] || {}
|
|
280
|
+
|
|
281
|
+
# http body (model)
|
|
282
|
+
post_body = opts[:debug_body]
|
|
283
|
+
|
|
284
|
+
# return_type
|
|
285
|
+
return_type = opts[:debug_return_type] || 'GetWhatsAppFlow200Response'
|
|
286
|
+
|
|
287
|
+
# auth_names
|
|
288
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
289
|
+
|
|
290
|
+
new_options = opts.merge(
|
|
291
|
+
:operation => :"WhatsAppFlowsApi.get_whats_app_flow",
|
|
292
|
+
:header_params => header_params,
|
|
293
|
+
:query_params => query_params,
|
|
294
|
+
:form_params => form_params,
|
|
295
|
+
:body => post_body,
|
|
296
|
+
:auth_names => auth_names,
|
|
297
|
+
:return_type => return_type
|
|
298
|
+
)
|
|
299
|
+
|
|
300
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
301
|
+
if @api_client.config.debugging
|
|
302
|
+
@api_client.config.logger.debug "API called: WhatsAppFlowsApi#get_whats_app_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
303
|
+
end
|
|
304
|
+
return data, status_code, headers
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
# Get flow JSON asset
|
|
308
|
+
# Get the flow JSON asset metadata, including a temporary download URL for the Flow JSON file.
|
|
309
|
+
# @param flow_id [String] Flow ID
|
|
310
|
+
# @param account_id [String] WhatsApp social account ID
|
|
311
|
+
# @param [Hash] opts the optional parameters
|
|
312
|
+
# @return [GetWhatsAppFlowJson200Response]
|
|
313
|
+
def get_whats_app_flow_json(flow_id, account_id, opts = {})
|
|
314
|
+
data, _status_code, _headers = get_whats_app_flow_json_with_http_info(flow_id, account_id, opts)
|
|
315
|
+
data
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
# Get flow JSON asset
|
|
319
|
+
# Get the flow JSON asset metadata, including a temporary download URL for the Flow JSON file.
|
|
320
|
+
# @param flow_id [String] Flow ID
|
|
321
|
+
# @param account_id [String] WhatsApp social account ID
|
|
322
|
+
# @param [Hash] opts the optional parameters
|
|
323
|
+
# @return [Array<(GetWhatsAppFlowJson200Response, Integer, Hash)>] GetWhatsAppFlowJson200Response data, response status code and response headers
|
|
324
|
+
def get_whats_app_flow_json_with_http_info(flow_id, account_id, opts = {})
|
|
325
|
+
if @api_client.config.debugging
|
|
326
|
+
@api_client.config.logger.debug 'Calling API: WhatsAppFlowsApi.get_whats_app_flow_json ...'
|
|
327
|
+
end
|
|
328
|
+
# verify the required parameter 'flow_id' is set
|
|
329
|
+
if @api_client.config.client_side_validation && flow_id.nil?
|
|
330
|
+
fail ArgumentError, "Missing the required parameter 'flow_id' when calling WhatsAppFlowsApi.get_whats_app_flow_json"
|
|
331
|
+
end
|
|
332
|
+
# verify the required parameter 'account_id' is set
|
|
333
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
334
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling WhatsAppFlowsApi.get_whats_app_flow_json"
|
|
335
|
+
end
|
|
336
|
+
# resource path
|
|
337
|
+
local_var_path = '/v1/whatsapp/flows/{flowId}/json'.sub('{' + 'flowId' + '}', CGI.escape(flow_id.to_s))
|
|
338
|
+
|
|
339
|
+
# query parameters
|
|
340
|
+
query_params = opts[:query_params] || {}
|
|
341
|
+
query_params[:'accountId'] = account_id
|
|
342
|
+
|
|
343
|
+
# header parameters
|
|
344
|
+
header_params = opts[:header_params] || {}
|
|
345
|
+
# HTTP header 'Accept' (if needed)
|
|
346
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
347
|
+
|
|
348
|
+
# form parameters
|
|
349
|
+
form_params = opts[:form_params] || {}
|
|
350
|
+
|
|
351
|
+
# http body (model)
|
|
352
|
+
post_body = opts[:debug_body]
|
|
353
|
+
|
|
354
|
+
# return_type
|
|
355
|
+
return_type = opts[:debug_return_type] || 'GetWhatsAppFlowJson200Response'
|
|
356
|
+
|
|
357
|
+
# auth_names
|
|
358
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
359
|
+
|
|
360
|
+
new_options = opts.merge(
|
|
361
|
+
:operation => :"WhatsAppFlowsApi.get_whats_app_flow_json",
|
|
362
|
+
:header_params => header_params,
|
|
363
|
+
:query_params => query_params,
|
|
364
|
+
:form_params => form_params,
|
|
365
|
+
:body => post_body,
|
|
366
|
+
:auth_names => auth_names,
|
|
367
|
+
:return_type => return_type
|
|
368
|
+
)
|
|
369
|
+
|
|
370
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
371
|
+
if @api_client.config.debugging
|
|
372
|
+
@api_client.config.logger.debug "API called: WhatsAppFlowsApi#get_whats_app_flow_json\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
373
|
+
end
|
|
374
|
+
return data, status_code, headers
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
# List flows
|
|
378
|
+
# List all WhatsApp Flows for the Business Account (WABA) associated with the given account.
|
|
379
|
+
# @param account_id [String] WhatsApp social account ID
|
|
380
|
+
# @param [Hash] opts the optional parameters
|
|
381
|
+
# @return [ListWhatsAppFlows200Response]
|
|
382
|
+
def list_whats_app_flows(account_id, opts = {})
|
|
383
|
+
data, _status_code, _headers = list_whats_app_flows_with_http_info(account_id, opts)
|
|
384
|
+
data
|
|
385
|
+
end
|
|
386
|
+
|
|
387
|
+
# List flows
|
|
388
|
+
# List all WhatsApp Flows for the Business Account (WABA) associated with the given account.
|
|
389
|
+
# @param account_id [String] WhatsApp social account ID
|
|
390
|
+
# @param [Hash] opts the optional parameters
|
|
391
|
+
# @return [Array<(ListWhatsAppFlows200Response, Integer, Hash)>] ListWhatsAppFlows200Response data, response status code and response headers
|
|
392
|
+
def list_whats_app_flows_with_http_info(account_id, opts = {})
|
|
393
|
+
if @api_client.config.debugging
|
|
394
|
+
@api_client.config.logger.debug 'Calling API: WhatsAppFlowsApi.list_whats_app_flows ...'
|
|
395
|
+
end
|
|
396
|
+
# verify the required parameter 'account_id' is set
|
|
397
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
398
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling WhatsAppFlowsApi.list_whats_app_flows"
|
|
399
|
+
end
|
|
400
|
+
# resource path
|
|
401
|
+
local_var_path = '/v1/whatsapp/flows'
|
|
402
|
+
|
|
403
|
+
# query parameters
|
|
404
|
+
query_params = opts[:query_params] || {}
|
|
405
|
+
query_params[:'accountId'] = account_id
|
|
406
|
+
|
|
407
|
+
# header parameters
|
|
408
|
+
header_params = opts[:header_params] || {}
|
|
409
|
+
# HTTP header 'Accept' (if needed)
|
|
410
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
411
|
+
|
|
412
|
+
# form parameters
|
|
413
|
+
form_params = opts[:form_params] || {}
|
|
414
|
+
|
|
415
|
+
# http body (model)
|
|
416
|
+
post_body = opts[:debug_body]
|
|
417
|
+
|
|
418
|
+
# return_type
|
|
419
|
+
return_type = opts[:debug_return_type] || 'ListWhatsAppFlows200Response'
|
|
420
|
+
|
|
421
|
+
# auth_names
|
|
422
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
423
|
+
|
|
424
|
+
new_options = opts.merge(
|
|
425
|
+
:operation => :"WhatsAppFlowsApi.list_whats_app_flows",
|
|
426
|
+
:header_params => header_params,
|
|
427
|
+
:query_params => query_params,
|
|
428
|
+
:form_params => form_params,
|
|
429
|
+
:body => post_body,
|
|
430
|
+
:auth_names => auth_names,
|
|
431
|
+
:return_type => return_type
|
|
432
|
+
)
|
|
433
|
+
|
|
434
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
435
|
+
if @api_client.config.debugging
|
|
436
|
+
@api_client.config.logger.debug "API called: WhatsAppFlowsApi#list_whats_app_flows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
437
|
+
end
|
|
438
|
+
return data, status_code, headers
|
|
439
|
+
end
|
|
440
|
+
|
|
441
|
+
# Publish flow
|
|
442
|
+
# 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`).
|
|
443
|
+
# @param flow_id [String] Flow ID
|
|
444
|
+
# @param publish_whats_app_flow_request [PublishWhatsAppFlowRequest]
|
|
445
|
+
# @param [Hash] opts the optional parameters
|
|
446
|
+
# @return [UpdateYoutubeDefaultPlaylist200Response]
|
|
447
|
+
def publish_whats_app_flow(flow_id, publish_whats_app_flow_request, opts = {})
|
|
448
|
+
data, _status_code, _headers = publish_whats_app_flow_with_http_info(flow_id, publish_whats_app_flow_request, opts)
|
|
449
|
+
data
|
|
450
|
+
end
|
|
451
|
+
|
|
452
|
+
# Publish flow
|
|
453
|
+
# 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`).
|
|
454
|
+
# @param flow_id [String] Flow ID
|
|
455
|
+
# @param publish_whats_app_flow_request [PublishWhatsAppFlowRequest]
|
|
456
|
+
# @param [Hash] opts the optional parameters
|
|
457
|
+
# @return [Array<(UpdateYoutubeDefaultPlaylist200Response, Integer, Hash)>] UpdateYoutubeDefaultPlaylist200Response data, response status code and response headers
|
|
458
|
+
def publish_whats_app_flow_with_http_info(flow_id, publish_whats_app_flow_request, opts = {})
|
|
459
|
+
if @api_client.config.debugging
|
|
460
|
+
@api_client.config.logger.debug 'Calling API: WhatsAppFlowsApi.publish_whats_app_flow ...'
|
|
461
|
+
end
|
|
462
|
+
# verify the required parameter 'flow_id' is set
|
|
463
|
+
if @api_client.config.client_side_validation && flow_id.nil?
|
|
464
|
+
fail ArgumentError, "Missing the required parameter 'flow_id' when calling WhatsAppFlowsApi.publish_whats_app_flow"
|
|
465
|
+
end
|
|
466
|
+
# verify the required parameter 'publish_whats_app_flow_request' is set
|
|
467
|
+
if @api_client.config.client_side_validation && publish_whats_app_flow_request.nil?
|
|
468
|
+
fail ArgumentError, "Missing the required parameter 'publish_whats_app_flow_request' when calling WhatsAppFlowsApi.publish_whats_app_flow"
|
|
469
|
+
end
|
|
470
|
+
# resource path
|
|
471
|
+
local_var_path = '/v1/whatsapp/flows/{flowId}/publish'.sub('{' + 'flowId' + '}', CGI.escape(flow_id.to_s))
|
|
472
|
+
|
|
473
|
+
# query parameters
|
|
474
|
+
query_params = opts[:query_params] || {}
|
|
475
|
+
|
|
476
|
+
# header parameters
|
|
477
|
+
header_params = opts[:header_params] || {}
|
|
478
|
+
# HTTP header 'Accept' (if needed)
|
|
479
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
480
|
+
# HTTP header 'Content-Type'
|
|
481
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
482
|
+
if !content_type.nil?
|
|
483
|
+
header_params['Content-Type'] = content_type
|
|
484
|
+
end
|
|
485
|
+
|
|
486
|
+
# form parameters
|
|
487
|
+
form_params = opts[:form_params] || {}
|
|
488
|
+
|
|
489
|
+
# http body (model)
|
|
490
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(publish_whats_app_flow_request)
|
|
491
|
+
|
|
492
|
+
# return_type
|
|
493
|
+
return_type = opts[:debug_return_type] || 'UpdateYoutubeDefaultPlaylist200Response'
|
|
494
|
+
|
|
495
|
+
# auth_names
|
|
496
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
497
|
+
|
|
498
|
+
new_options = opts.merge(
|
|
499
|
+
:operation => :"WhatsAppFlowsApi.publish_whats_app_flow",
|
|
500
|
+
:header_params => header_params,
|
|
501
|
+
:query_params => query_params,
|
|
502
|
+
:form_params => form_params,
|
|
503
|
+
:body => post_body,
|
|
504
|
+
:auth_names => auth_names,
|
|
505
|
+
:return_type => return_type
|
|
506
|
+
)
|
|
507
|
+
|
|
508
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
509
|
+
if @api_client.config.debugging
|
|
510
|
+
@api_client.config.logger.debug "API called: WhatsAppFlowsApi#publish_whats_app_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
511
|
+
end
|
|
512
|
+
return data, status_code, headers
|
|
513
|
+
end
|
|
514
|
+
|
|
515
|
+
# Send flow message
|
|
516
|
+
# 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.
|
|
517
|
+
# @param send_whats_app_flow_message_request [SendWhatsAppFlowMessageRequest]
|
|
518
|
+
# @param [Hash] opts the optional parameters
|
|
519
|
+
# @return [SendWhatsAppFlowMessage200Response]
|
|
520
|
+
def send_whats_app_flow_message(send_whats_app_flow_message_request, opts = {})
|
|
521
|
+
data, _status_code, _headers = send_whats_app_flow_message_with_http_info(send_whats_app_flow_message_request, opts)
|
|
522
|
+
data
|
|
523
|
+
end
|
|
524
|
+
|
|
525
|
+
# Send flow message
|
|
526
|
+
# 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.
|
|
527
|
+
# @param send_whats_app_flow_message_request [SendWhatsAppFlowMessageRequest]
|
|
528
|
+
# @param [Hash] opts the optional parameters
|
|
529
|
+
# @return [Array<(SendWhatsAppFlowMessage200Response, Integer, Hash)>] SendWhatsAppFlowMessage200Response data, response status code and response headers
|
|
530
|
+
def send_whats_app_flow_message_with_http_info(send_whats_app_flow_message_request, opts = {})
|
|
531
|
+
if @api_client.config.debugging
|
|
532
|
+
@api_client.config.logger.debug 'Calling API: WhatsAppFlowsApi.send_whats_app_flow_message ...'
|
|
533
|
+
end
|
|
534
|
+
# verify the required parameter 'send_whats_app_flow_message_request' is set
|
|
535
|
+
if @api_client.config.client_side_validation && send_whats_app_flow_message_request.nil?
|
|
536
|
+
fail ArgumentError, "Missing the required parameter 'send_whats_app_flow_message_request' when calling WhatsAppFlowsApi.send_whats_app_flow_message"
|
|
537
|
+
end
|
|
538
|
+
# resource path
|
|
539
|
+
local_var_path = '/v1/whatsapp/flows/send'
|
|
540
|
+
|
|
541
|
+
# query parameters
|
|
542
|
+
query_params = opts[:query_params] || {}
|
|
543
|
+
|
|
544
|
+
# header parameters
|
|
545
|
+
header_params = opts[:header_params] || {}
|
|
546
|
+
# HTTP header 'Accept' (if needed)
|
|
547
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
548
|
+
# HTTP header 'Content-Type'
|
|
549
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
550
|
+
if !content_type.nil?
|
|
551
|
+
header_params['Content-Type'] = content_type
|
|
552
|
+
end
|
|
553
|
+
|
|
554
|
+
# form parameters
|
|
555
|
+
form_params = opts[:form_params] || {}
|
|
556
|
+
|
|
557
|
+
# http body (model)
|
|
558
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(send_whats_app_flow_message_request)
|
|
559
|
+
|
|
560
|
+
# return_type
|
|
561
|
+
return_type = opts[:debug_return_type] || 'SendWhatsAppFlowMessage200Response'
|
|
562
|
+
|
|
563
|
+
# auth_names
|
|
564
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
565
|
+
|
|
566
|
+
new_options = opts.merge(
|
|
567
|
+
:operation => :"WhatsAppFlowsApi.send_whats_app_flow_message",
|
|
568
|
+
:header_params => header_params,
|
|
569
|
+
:query_params => query_params,
|
|
570
|
+
:form_params => form_params,
|
|
571
|
+
:body => post_body,
|
|
572
|
+
:auth_names => auth_names,
|
|
573
|
+
:return_type => return_type
|
|
574
|
+
)
|
|
575
|
+
|
|
576
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
577
|
+
if @api_client.config.debugging
|
|
578
|
+
@api_client.config.logger.debug "API called: WhatsAppFlowsApi#send_whats_app_flow_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
579
|
+
end
|
|
580
|
+
return data, status_code, headers
|
|
581
|
+
end
|
|
582
|
+
|
|
583
|
+
# Update flow
|
|
584
|
+
# Update metadata (name, categories) of a DRAFT flow. Published flows are immutable.
|
|
585
|
+
# @param flow_id [String] Flow ID
|
|
586
|
+
# @param update_whats_app_flow_request [UpdateWhatsAppFlowRequest]
|
|
587
|
+
# @param [Hash] opts the optional parameters
|
|
588
|
+
# @return [UpdateYoutubeDefaultPlaylist200Response]
|
|
589
|
+
def update_whats_app_flow(flow_id, update_whats_app_flow_request, opts = {})
|
|
590
|
+
data, _status_code, _headers = update_whats_app_flow_with_http_info(flow_id, update_whats_app_flow_request, opts)
|
|
591
|
+
data
|
|
592
|
+
end
|
|
593
|
+
|
|
594
|
+
# Update flow
|
|
595
|
+
# Update metadata (name, categories) of a DRAFT flow. Published flows are immutable.
|
|
596
|
+
# @param flow_id [String] Flow ID
|
|
597
|
+
# @param update_whats_app_flow_request [UpdateWhatsAppFlowRequest]
|
|
598
|
+
# @param [Hash] opts the optional parameters
|
|
599
|
+
# @return [Array<(UpdateYoutubeDefaultPlaylist200Response, Integer, Hash)>] UpdateYoutubeDefaultPlaylist200Response data, response status code and response headers
|
|
600
|
+
def update_whats_app_flow_with_http_info(flow_id, update_whats_app_flow_request, opts = {})
|
|
601
|
+
if @api_client.config.debugging
|
|
602
|
+
@api_client.config.logger.debug 'Calling API: WhatsAppFlowsApi.update_whats_app_flow ...'
|
|
603
|
+
end
|
|
604
|
+
# verify the required parameter 'flow_id' is set
|
|
605
|
+
if @api_client.config.client_side_validation && flow_id.nil?
|
|
606
|
+
fail ArgumentError, "Missing the required parameter 'flow_id' when calling WhatsAppFlowsApi.update_whats_app_flow"
|
|
607
|
+
end
|
|
608
|
+
# verify the required parameter 'update_whats_app_flow_request' is set
|
|
609
|
+
if @api_client.config.client_side_validation && update_whats_app_flow_request.nil?
|
|
610
|
+
fail ArgumentError, "Missing the required parameter 'update_whats_app_flow_request' when calling WhatsAppFlowsApi.update_whats_app_flow"
|
|
611
|
+
end
|
|
612
|
+
# resource path
|
|
613
|
+
local_var_path = '/v1/whatsapp/flows/{flowId}'.sub('{' + 'flowId' + '}', CGI.escape(flow_id.to_s))
|
|
614
|
+
|
|
615
|
+
# query parameters
|
|
616
|
+
query_params = opts[:query_params] || {}
|
|
617
|
+
|
|
618
|
+
# header parameters
|
|
619
|
+
header_params = opts[:header_params] || {}
|
|
620
|
+
# HTTP header 'Accept' (if needed)
|
|
621
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
622
|
+
# HTTP header 'Content-Type'
|
|
623
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
624
|
+
if !content_type.nil?
|
|
625
|
+
header_params['Content-Type'] = content_type
|
|
626
|
+
end
|
|
627
|
+
|
|
628
|
+
# form parameters
|
|
629
|
+
form_params = opts[:form_params] || {}
|
|
630
|
+
|
|
631
|
+
# http body (model)
|
|
632
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_whats_app_flow_request)
|
|
633
|
+
|
|
634
|
+
# return_type
|
|
635
|
+
return_type = opts[:debug_return_type] || 'UpdateYoutubeDefaultPlaylist200Response'
|
|
636
|
+
|
|
637
|
+
# auth_names
|
|
638
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
639
|
+
|
|
640
|
+
new_options = opts.merge(
|
|
641
|
+
:operation => :"WhatsAppFlowsApi.update_whats_app_flow",
|
|
642
|
+
:header_params => header_params,
|
|
643
|
+
:query_params => query_params,
|
|
644
|
+
:form_params => form_params,
|
|
645
|
+
:body => post_body,
|
|
646
|
+
:auth_names => auth_names,
|
|
647
|
+
:return_type => return_type
|
|
648
|
+
)
|
|
649
|
+
|
|
650
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
651
|
+
if @api_client.config.debugging
|
|
652
|
+
@api_client.config.logger.debug "API called: WhatsAppFlowsApi#update_whats_app_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
653
|
+
end
|
|
654
|
+
return data, status_code, headers
|
|
655
|
+
end
|
|
656
|
+
|
|
657
|
+
# Upload flow JSON
|
|
658
|
+
# 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: https://developers.facebook.com/docs/whatsapp/flows/reference/flowjson
|
|
659
|
+
# @param flow_id [String] Flow ID
|
|
660
|
+
# @param upload_whats_app_flow_json_request [UploadWhatsAppFlowJsonRequest]
|
|
661
|
+
# @param [Hash] opts the optional parameters
|
|
662
|
+
# @return [UploadWhatsAppFlowJson200Response]
|
|
663
|
+
def upload_whats_app_flow_json(flow_id, upload_whats_app_flow_json_request, opts = {})
|
|
664
|
+
data, _status_code, _headers = upload_whats_app_flow_json_with_http_info(flow_id, upload_whats_app_flow_json_request, opts)
|
|
665
|
+
data
|
|
666
|
+
end
|
|
667
|
+
|
|
668
|
+
# Upload flow JSON
|
|
669
|
+
# 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: https://developers.facebook.com/docs/whatsapp/flows/reference/flowjson
|
|
670
|
+
# @param flow_id [String] Flow ID
|
|
671
|
+
# @param upload_whats_app_flow_json_request [UploadWhatsAppFlowJsonRequest]
|
|
672
|
+
# @param [Hash] opts the optional parameters
|
|
673
|
+
# @return [Array<(UploadWhatsAppFlowJson200Response, Integer, Hash)>] UploadWhatsAppFlowJson200Response data, response status code and response headers
|
|
674
|
+
def upload_whats_app_flow_json_with_http_info(flow_id, upload_whats_app_flow_json_request, opts = {})
|
|
675
|
+
if @api_client.config.debugging
|
|
676
|
+
@api_client.config.logger.debug 'Calling API: WhatsAppFlowsApi.upload_whats_app_flow_json ...'
|
|
677
|
+
end
|
|
678
|
+
# verify the required parameter 'flow_id' is set
|
|
679
|
+
if @api_client.config.client_side_validation && flow_id.nil?
|
|
680
|
+
fail ArgumentError, "Missing the required parameter 'flow_id' when calling WhatsAppFlowsApi.upload_whats_app_flow_json"
|
|
681
|
+
end
|
|
682
|
+
# verify the required parameter 'upload_whats_app_flow_json_request' is set
|
|
683
|
+
if @api_client.config.client_side_validation && upload_whats_app_flow_json_request.nil?
|
|
684
|
+
fail ArgumentError, "Missing the required parameter 'upload_whats_app_flow_json_request' when calling WhatsAppFlowsApi.upload_whats_app_flow_json"
|
|
685
|
+
end
|
|
686
|
+
# resource path
|
|
687
|
+
local_var_path = '/v1/whatsapp/flows/{flowId}/json'.sub('{' + 'flowId' + '}', CGI.escape(flow_id.to_s))
|
|
688
|
+
|
|
689
|
+
# query parameters
|
|
690
|
+
query_params = opts[:query_params] || {}
|
|
691
|
+
|
|
692
|
+
# header parameters
|
|
693
|
+
header_params = opts[:header_params] || {}
|
|
694
|
+
# HTTP header 'Accept' (if needed)
|
|
695
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
696
|
+
# HTTP header 'Content-Type'
|
|
697
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
698
|
+
if !content_type.nil?
|
|
699
|
+
header_params['Content-Type'] = content_type
|
|
700
|
+
end
|
|
701
|
+
|
|
702
|
+
# form parameters
|
|
703
|
+
form_params = opts[:form_params] || {}
|
|
704
|
+
|
|
705
|
+
# http body (model)
|
|
706
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(upload_whats_app_flow_json_request)
|
|
707
|
+
|
|
708
|
+
# return_type
|
|
709
|
+
return_type = opts[:debug_return_type] || 'UploadWhatsAppFlowJson200Response'
|
|
710
|
+
|
|
711
|
+
# auth_names
|
|
712
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
713
|
+
|
|
714
|
+
new_options = opts.merge(
|
|
715
|
+
:operation => :"WhatsAppFlowsApi.upload_whats_app_flow_json",
|
|
716
|
+
:header_params => header_params,
|
|
717
|
+
:query_params => query_params,
|
|
718
|
+
:form_params => form_params,
|
|
719
|
+
:body => post_body,
|
|
720
|
+
:auth_names => auth_names,
|
|
721
|
+
:return_type => return_type
|
|
722
|
+
)
|
|
723
|
+
|
|
724
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
725
|
+
if @api_client.config.debugging
|
|
726
|
+
@api_client.config.logger.debug "API called: WhatsAppFlowsApi#upload_whats_app_flow_json\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
727
|
+
end
|
|
728
|
+
return data, status_code, headers
|
|
729
|
+
end
|
|
730
|
+
end
|
|
731
|
+
end
|