class SmoochApi::DeploymentApi
Attributes
Public Class Methods
# File lib/smooch-api/api/deployment_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Activate a phone number on the specified deployment. @param deploymentId Identifies the deployment. @param deploymentActivatePhoneNumberBody Body for an activatePhoneNumber request. @param [Hash] opts the optional parameters @return [DeploymentResponse]
# 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 a phone number on the specified deployment. @param deploymentId Identifies the deployment. @param deploymentActivatePhoneNumberBody Body for an activatePhoneNumber request. @param [Hash] opts the optional parameters @return [Array<(DeploymentResponse
, Fixnum, Hash)>] DeploymentResponse
data, response status code and response headers
# 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 to complete phone number activation. @param deploymentId Identifies the deployment. @param deploymentConfirmCode Body for a confirmCode request. @param [Hash] opts the optional parameters @return [DeploymentResponse]
# 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 to complete phone number activation. @param deploymentId Identifies the deployment. @param deploymentConfirmCode Body for a confirmCode request. @param [Hash] opts the optional parameters @return [Array<(DeploymentResponse
, Fixnum, Hash)>] DeploymentResponse
data, response status code and response headers
# 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 a WhatsApp deployment. @param deploymentCreateBody Body for a createDeployment request. @param [Hash] opts the optional parameters @return [DeploymentResponse]
# 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 a WhatsApp deployment. @param deploymentCreateBody Body for a createDeployment request. @param [Hash] opts the optional parameters @return [Array<(DeploymentResponse
, Fixnum, Hash)>] DeploymentResponse
data, response status code and response headers
# 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 the specified deployment. @param deploymentId Identifies the deployment. @param [Hash] opts the optional parameters @return [nil]
# 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 the specified deployment. @param deploymentId Identifies the deployment. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# 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 the specified deployment. @param deploymentId Identifies the deployment. @param [Hash] opts the optional parameters @return [DeploymentResponse]
# 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 the specified deployment. @param deploymentId Identifies the deployment. @param [Hash] opts the optional parameters @return [Array<(DeploymentResponse
, Fixnum, Hash)>] DeploymentResponse
data, response status code and response headers
# 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 owned WhatsApp deployments. @param [Hash] opts the optional parameters @return [ListDeploymentsResponse]
# 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 owned WhatsApp deployments. @param [Hash] opts the optional parameters @return [Array<(ListDeploymentsResponse
, Fixnum, Hash)>] ListDeploymentsResponse
data, response status code and response headers
# 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