Class: SmoochApi::DeploymentApi

Inherits:
Object
  • Object
show all
Defined in:
lib/smooch-api/api/deployment_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DeploymentApi

Returns a new instance of DeploymentApi.



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

def api_client
  @api_client
end

Instance Method Details

#activate_phone_number(deploymentId, deploymentActivatePhoneNumberBody, opts = {}) ⇒ DeploymentResponse

Activate a phone number on the specified deployment.

Parameters:

  • deploymentId

    Identifies the deployment.

  • deploymentActivatePhoneNumberBody

    Body for an activatePhoneNumber request.

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

    the optional parameters

Returns:



29
30
31
32
# File 'lib/smooch-api/api/deployment_api.rb', line 29

def activate_phone_number(deploymentId, deploymentActivatePhoneNumberBody, opts = {})
  data, _status_code, _headers = activate_phone_number_with_http_info(deploymentId, deploymentActivatePhoneNumberBody, opts)
  return data
end

#activate_phone_number_with_http_info(deploymentId, deploymentActivatePhoneNumberBody, opts = {}) ⇒ Array<(DeploymentResponse, Fixnum, Hash)>

Activate a phone number on the specified deployment.

Parameters:

  • deploymentId

    Identifies the deployment.

  • deploymentActivatePhoneNumberBody

    Body for an activatePhoneNumber request.

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

    the optional parameters

Returns:

  • (Array<(DeploymentResponse, Fixnum, Hash)>)

    DeploymentResponse data, response status code and response headers



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
# File 'lib/smooch-api/api/deployment_api.rb', line 40

def activate_phone_number_with_http_info(deploymentId, deploymentActivatePhoneNumberBody, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DeploymentApi.activate_phone_number ..."
  end
  # verify the required parameter 'deploymentId' is set
  if @api_client.config.client_side_validation && deploymentId.nil?
    fail ArgumentError, "Missing the required parameter 'deploymentId' when calling DeploymentApi.activate_phone_number"
  end
  # verify the required parameter 'deploymentActivatePhoneNumberBody' is set
  if @api_client.config.client_side_validation && deploymentActivatePhoneNumberBody.nil?
    fail ArgumentError, "Missing the required parameter 'deploymentActivatePhoneNumberBody' when calling DeploymentApi.activate_phone_number"
  end
  # resource path
  local_var_path = "/v1.1/whatsapp/deployments/{deploymentId}/activate".sub('{' + 'deploymentId' + '}', deploymentId.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(deploymentActivatePhoneNumberBody)
  auth_names = ['basicAuth', 'jwt']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DeploymentResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DeploymentApi#activate_phone_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#confirm_code(deploymentId, deploymentConfirmCode, opts = {}) ⇒ DeploymentResponse

Confirm code to complete phone number activation.

Parameters:

  • deploymentId

    Identifies the deployment.

  • deploymentConfirmCode

    Body for a confirmCode request.

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

    the optional parameters

Returns:



90
91
92
93
# File 'lib/smooch-api/api/deployment_api.rb', line 90

def confirm_code(deploymentId, deploymentConfirmCode, opts = {})
  data, _status_code, _headers = confirm_code_with_http_info(deploymentId, deploymentConfirmCode, opts)
  return data
end

#confirm_code_with_http_info(deploymentId, deploymentConfirmCode, opts = {}) ⇒ Array<(DeploymentResponse, Fixnum, Hash)>

Confirm code to complete phone number activation.

Parameters:

  • deploymentId

    Identifies the deployment.

  • deploymentConfirmCode

    Body for a confirmCode request.

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

    the optional parameters

Returns:

  • (Array<(DeploymentResponse, Fixnum, Hash)>)

    DeploymentResponse data, response status code and response headers



101
102
103
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
# File 'lib/smooch-api/api/deployment_api.rb', line 101

def confirm_code_with_http_info(deploymentId, deploymentConfirmCode, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DeploymentApi.confirm_code ..."
  end
  # verify the required parameter 'deploymentId' is set
  if @api_client.config.client_side_validation && deploymentId.nil?
    fail ArgumentError, "Missing the required parameter 'deploymentId' when calling DeploymentApi.confirm_code"
  end
  # verify the required parameter 'deploymentConfirmCode' is set
  if @api_client.config.client_side_validation && deploymentConfirmCode.nil?
    fail ArgumentError, "Missing the required parameter 'deploymentConfirmCode' when calling DeploymentApi.confirm_code"
  end
  # resource path
  local_var_path = "/v1.1/whatsapp/deployments/{deploymentId}/code/confirm".sub('{' + 'deploymentId' + '}', deploymentId.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(deploymentConfirmCode)
  auth_names = ['basicAuth', 'jwt']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DeploymentResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DeploymentApi#confirm_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_deployment(deploymentCreateBody, opts = {}) ⇒ DeploymentResponse

Create a WhatsApp deployment.

Parameters:

  • deploymentCreateBody

    Body for a createDeployment request.

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

    the optional parameters

Returns:



150
151
152
153
# File 'lib/smooch-api/api/deployment_api.rb', line 150

def create_deployment(deploymentCreateBody, opts = {})
  data, _status_code, _headers = create_deployment_with_http_info(deploymentCreateBody, opts)
  return data
end

#create_deployment_with_http_info(deploymentCreateBody, opts = {}) ⇒ Array<(DeploymentResponse, Fixnum, Hash)>

Create a WhatsApp deployment.

Parameters:

  • deploymentCreateBody

    Body for a createDeployment request.

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

    the optional parameters

Returns:

  • (Array<(DeploymentResponse, Fixnum, Hash)>)

    DeploymentResponse data, response status code and response headers



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/smooch-api/api/deployment_api.rb', line 160

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

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(deploymentCreateBody)
  auth_names = ['basicAuth', 'jwt']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DeploymentResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DeploymentApi#create_deployment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_deployment(deploymentId, opts = {}) ⇒ nil

Delete the specified deployment.

Parameters:

  • deploymentId

    Identifies the deployment.

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

    the optional parameters

Returns:

  • (nil)


205
206
207
208
# File 'lib/smooch-api/api/deployment_api.rb', line 205

def delete_deployment(deploymentId, opts = {})
  delete_deployment_with_http_info(deploymentId, opts)
  return nil
end

#delete_deployment_with_http_info(deploymentId, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete the specified deployment.

Parameters:

  • deploymentId

    Identifies the deployment.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'lib/smooch-api/api/deployment_api.rb', line 215

def delete_deployment_with_http_info(deploymentId, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DeploymentApi.delete_deployment ..."
  end
  # verify the required parameter 'deploymentId' is set
  if @api_client.config.client_side_validation && deploymentId.nil?
    fail ArgumentError, "Missing the required parameter 'deploymentId' when calling DeploymentApi.delete_deployment"
  end
  # resource path
  local_var_path = "/v1.1/whatsapp/deployments/{deploymentId}".sub('{' + 'deploymentId' + '}', deploymentId.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth', 'jwt']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DeploymentApi#delete_deployment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_deployment(deploymentId, opts = {}) ⇒ DeploymentResponse

Get the specified deployment.

Parameters:

  • deploymentId

    Identifies the deployment.

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

    the optional parameters

Returns:



259
260
261
262
# File 'lib/smooch-api/api/deployment_api.rb', line 259

def get_deployment(deploymentId, opts = {})
  data, _status_code, _headers = get_deployment_with_http_info(deploymentId, opts)
  return data
end

#get_deployment_with_http_info(deploymentId, opts = {}) ⇒ Array<(DeploymentResponse, Fixnum, Hash)>

Get the specified deployment.

Parameters:

  • deploymentId

    Identifies the deployment.

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

    the optional parameters

Returns:

  • (Array<(DeploymentResponse, Fixnum, Hash)>)

    DeploymentResponse data, response status code and response headers



269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
# File 'lib/smooch-api/api/deployment_api.rb', line 269

def get_deployment_with_http_info(deploymentId, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DeploymentApi.get_deployment ..."
  end
  # verify the required parameter 'deploymentId' is set
  if @api_client.config.client_side_validation && deploymentId.nil?
    fail ArgumentError, "Missing the required parameter 'deploymentId' when calling DeploymentApi.get_deployment"
  end
  # resource path
  local_var_path = "/v1.1/whatsapp/deployments/{deploymentId}".sub('{' + 'deploymentId' + '}', deploymentId.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth', 'jwt']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DeploymentResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DeploymentApi#get_deployment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_deployments(opts = {}) ⇒ ListDeploymentsResponse

List owned WhatsApp deployments.

Parameters:

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

    the optional parameters

Returns:



313
314
315
316
# File 'lib/smooch-api/api/deployment_api.rb', line 313

def list_deployments(opts = {})
  data, _status_code, _headers = list_deployments_with_http_info(opts)
  return data
end

#list_deployments_with_http_info(opts = {}) ⇒ Array<(ListDeploymentsResponse, Fixnum, Hash)>

List owned WhatsApp deployments.

Parameters:

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

    the optional parameters

Returns:

  • (Array<(ListDeploymentsResponse, Fixnum, Hash)>)

    ListDeploymentsResponse data, response status code and response headers



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
# File 'lib/smooch-api/api/deployment_api.rb', line 322

def list_deployments_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DeploymentApi.list_deployments ..."
  end
  # resource path
  local_var_path = "/v1.1/whatsapp/deployments"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth', 'jwt']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListDeploymentsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DeploymentApi#list_deployments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end