class Telstra_Messaging::ProvisioningApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/Telstra_Messaging/api/provisioning_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

create_subscription(provision_number_request, opts = {}) click to toggle source

Create Subscription Invoke the provisioning API to get a dedicated mobile number for an account or application. Note that Free Trial apps will have a 30-Day Limit for their provisioned number. If the Provisioning call is made several times within that 30-Day period, it will return the `expiryDate` in the Unix format and will not add any activeDays until after that `expiryDate`. For paid apps, a provisioned number can be allotted for a maximum of 5 years. If a Provisioning call is made which will result to activeDays > 1830, the response body will indicate that the provisioned number is already valid for more than 5 years. @param provision_number_request A JSON payload containing the required attributes @param [Hash] opts the optional parameters @return [ProvisionNumberResponse]

# File lib/Telstra_Messaging/api/provisioning_api.rb, line 27
def create_subscription(provision_number_request, opts = {})
  data, _status_code, _headers = create_subscription_with_http_info(provision_number_request, opts)
  data
end
create_subscription_with_http_info(provision_number_request, opts = {}) click to toggle source

Create Subscription Invoke the provisioning API to get a dedicated mobile number for an account or application. Note that Free Trial apps will have a 30-Day Limit for their provisioned number. If the Provisioning call is made several times within that 30-Day period, it will return the &#x60;expiryDate&#x60; in the Unix format and will not add any activeDays until after that &#x60;expiryDate&#x60;. For paid apps, a provisioned number can be allotted for a maximum of 5 years. If a Provisioning call is made which will result to activeDays &gt; 1830, the response body will indicate that the provisioned number is already valid for more than 5 years. @param provision_number_request A JSON payload containing the required attributes @param [Hash] opts the optional parameters @return [Array<(ProvisionNumberResponse, Fixnum, Hash)>] ProvisionNumberResponse data, response status code and response headers

# File lib/Telstra_Messaging/api/provisioning_api.rb, line 37
def create_subscription_with_http_info(provision_number_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProvisioningApi.create_subscription ...'
  end
  # verify the required parameter 'provision_number_request' is set
  if @api_client.config.client_side_validation && provision_number_request.nil?
    fail ArgumentError, "Missing the required parameter 'provision_number_request' when calling ProvisioningApi.create_subscription"
  end
  # resource path
  local_var_path = '/messages/provisioning/subscriptions'

  # 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(provision_number_request)
  auth_names = ['auth']
  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 => 'ProvisionNumberResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProvisioningApi#create_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_subscription(delete_number_request, opts = {}) click to toggle source

Delete Subscription Delete a mobile number subscription from an account @param delete_number_request EmptyArr @param [Hash] opts the optional parameters @return [nil]

# File lib/Telstra_Messaging/api/provisioning_api.rb, line 81
def delete_subscription(delete_number_request, opts = {})
  delete_subscription_with_http_info(delete_number_request, opts)
  nil
end
delete_subscription_with_http_info(delete_number_request, opts = {}) click to toggle source

Delete Subscription Delete a mobile number subscription from an account @param delete_number_request EmptyArr @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/Telstra_Messaging/api/provisioning_api.rb, line 91
def delete_subscription_with_http_info(delete_number_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProvisioningApi.delete_subscription ...'
  end
  # verify the required parameter 'delete_number_request' is set
  if @api_client.config.client_side_validation && delete_number_request.nil?
    fail ArgumentError, "Missing the required parameter 'delete_number_request' when calling ProvisioningApi.delete_subscription"
  end
  # resource path
  local_var_path = '/messages/provisioning/subscriptions'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # 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(delete_number_request)
  auth_names = ['auth']
  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: ProvisioningApi#delete_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_subscription(opts = {}) click to toggle source

Get Subscription Get mobile number subscription for an account @param [Hash] opts the optional parameters @return [GetSubscriptionResponse]

# File lib/Telstra_Messaging/api/provisioning_api.rb, line 131
def get_subscription(opts = {})
  data, _status_code, _headers = get_subscription_with_http_info(opts)
  data
end
get_subscription_with_http_info(opts = {}) click to toggle source

Get Subscription Get mobile number subscription for an account @param [Hash] opts the optional parameters @return [Array<(GetSubscriptionResponse, Fixnum, Hash)>] GetSubscriptionResponse data, response status code and response headers

# File lib/Telstra_Messaging/api/provisioning_api.rb, line 140
def get_subscription_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProvisioningApi.get_subscription ...'
  end
  # resource path
  local_var_path = '/messages/provisioning/subscriptions'

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['auth']
  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 => 'GetSubscriptionResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProvisioningApi#get_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end