class DialMyCalls::AccountsApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

create_access_account(create_access_account_parameters, opts = {}) click to toggle source

Add Access Account Add a access account.
Returns a access account object on success, and returns an error otherwise.
“` curl -i -H "Content-Type: application/json" -X POST -d "{\"email\": \"test@test.com\", \"password\": \"1234A5678\", \"name\": \"John Doe\"}" $API_KEY@api.dialmycalls.com/2.0/accessaccount “` @param create_access_account_parameters Request body @param [Hash] opts the optional parameters @return [Object]

# File lib/dialmycalls_client/api/accounts_api.rb, line 39
def create_access_account(create_access_account_parameters, opts = {})
  data, _status_code, _headers = create_access_account_with_http_info(create_access_account_parameters, opts)
  return data
end
create_access_account_with_http_info(create_access_account_parameters, opts = {}) click to toggle source

Add Access Account Add a access account. &lt;br&gt;&lt;br&gt; Returns a access account object on success, and returns an error otherwise. &lt;br&gt;&lt;br&gt; &#x60;&#x60;&#x60; curl -i -H "Content-Type: application/json&quot; -X POST -d "{\&quot;email\&quot;: \&quot;test@test.com\&quot;, \&quot;password\&quot;: \&quot;1234A5678\&quot;, \&quot;name\&quot;: \&quot;John Doe\&quot;}&quot; $API_KEY@api.dialmycalls.com/2.0/accessaccount &#x60;&#x60;&#x60; @param create_access_account_parameters Request body @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers

# File lib/dialmycalls_client/api/accounts_api.rb, line 49
def create_access_account_with_http_info(create_access_account_parameters, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.create_access_account ..."
  end
  # verify the required parameter 'create_access_account_parameters' is set
  fail ArgumentError, "Missing the required parameter 'create_access_account_parameters' when calling AccountsApi.create_access_account" if create_access_account_parameters.nil?
  # resource path
  local_var_path = "/accessaccount".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json', 'application/xml']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'application/xml']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(create_access_account_parameters)
  auth_names = ['api_key']
  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 => 'Object')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#create_access_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_access_account_by_id(access_account_id, opts = {}) click to toggle source

Delete Access Account Delete a access account.
Returns the following if a valid identifier was provided, and returns an error otherwise.
“` curl -i -H "Content-Type: application/json" -X DELETE $API_KEY@api.dialmycalls.com/2.0/accessaccount/$ACCESSACCOUNT_ID “` @param access_account_id AccessAccountId @param [Hash] opts the optional parameters @return [Object]

# File lib/dialmycalls_client/api/accounts_api.rb, line 96
def delete_access_account_by_id(access_account_id, opts = {})
  data, _status_code, _headers = delete_access_account_by_id_with_http_info(access_account_id, opts)
  return data
end
delete_access_account_by_id_with_http_info(access_account_id, opts = {}) click to toggle source

Delete Access Account Delete a access account. &lt;br&gt;&lt;br&gt; Returns the following if a valid identifier was provided, and returns an error otherwise. &lt;br&gt;&lt;br&gt; &#x60;&#x60;&#x60; curl -i -H "Content-Type: application/json&quot; -X DELETE $API_KEY@api.dialmycalls.com/2.0/accessaccount/$ACCESSACCOUNT_ID &#x60;&#x60;&#x60; @param access_account_id AccessAccountId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers

# File lib/dialmycalls_client/api/accounts_api.rb, line 106
def delete_access_account_by_id_with_http_info(access_account_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.delete_access_account_by_id ..."
  end
  # verify the required parameter 'access_account_id' is set
  fail ArgumentError, "Missing the required parameter 'access_account_id' when calling AccountsApi.delete_access_account_by_id" if access_account_id.nil?
  # resource path
  local_var_path = "/accessaccount/{AccessAccountId}".sub('{format}','json').sub('{' + 'AccessAccountId' + '}', access_account_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json', 'application/xml']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'application/xml']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  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,
    :return_type => 'Object')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#delete_access_account_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_access_account_by_id(access_account_id, opts = {}) click to toggle source

Get Access Account Retrieve an access account.
Returns a access account object if a valid identifier was provided, and returns an error otherwise.
“` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/accessaccount/$ACCESSACCOUNT_ID “` @param access_account_id AccessAccountId @param [Hash] opts the optional parameters @return [Object]

# File lib/dialmycalls_client/api/accounts_api.rb, line 153
def get_access_account_by_id(access_account_id, opts = {})
  data, _status_code, _headers = get_access_account_by_id_with_http_info(access_account_id, opts)
  return data
end
get_access_account_by_id_with_http_info(access_account_id, opts = {}) click to toggle source

Get Access Account Retrieve an access account. &lt;br&gt;&lt;br&gt; Returns a access account object if a valid identifier was provided, and returns an error otherwise. &lt;br&gt;&lt;br&gt; &#x60;&#x60;&#x60; curl -i -H "Content-Type: application/json&quot; -X GET $API_KEY@api.dialmycalls.com/2.0/accessaccount/$ACCESSACCOUNT_ID &#x60;&#x60;&#x60; @param access_account_id AccessAccountId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers

# File lib/dialmycalls_client/api/accounts_api.rb, line 163
def get_access_account_by_id_with_http_info(access_account_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.get_access_account_by_id ..."
  end
  # verify the required parameter 'access_account_id' is set
  fail ArgumentError, "Missing the required parameter 'access_account_id' when calling AccountsApi.get_access_account_by_id" if access_account_id.nil?
  # resource path
  local_var_path = "/accessaccount/{AccessAccountId}".sub('{format}','json').sub('{' + 'AccessAccountId' + '}', access_account_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json', 'application/xml']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'application/xml']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  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 => 'Object')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#get_access_account_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_access_accounts(opts = {}) click to toggle source

List Access Accounts Retrieve a list of access accounts.
Returns a list of access account objects.
“` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/accessaccounts “` @param [Hash] opts the optional parameters @option opts [String] :range Range (ie "records&#x3D;201-300&quot;) of accessaccounts requested @return [Object]

# File lib/dialmycalls_client/api/accounts_api.rb, line 210
def get_access_accounts(opts = {})
  data, _status_code, _headers = get_access_accounts_with_http_info(opts)
  return data
end
get_access_accounts_with_http_info(opts = {}) click to toggle source

List Access Accounts Retrieve a list of access accounts. &lt;br&gt;&lt;br&gt; Returns a list of access account objects. &lt;br&gt;&lt;br&gt; &#x60;&#x60;&#x60; curl -i -H "Content-Type: application/json&quot; -X GET $API_KEY@api.dialmycalls.com/2.0/accessaccounts &#x60;&#x60;&#x60; @param [Hash] opts the optional parameters @option opts [String] :range Range (ie "records&#x3D;201-300&quot;) of accessaccounts requested @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers

# File lib/dialmycalls_client/api/accounts_api.rb, line 220
def get_access_accounts_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.get_access_accounts ..."
  end
  # resource path
  local_var_path = "/accessaccounts".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json', 'application/xml']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'application/xml']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
  header_params[:'Range'] = opts[:'range'] if !opts[:'range'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  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 => 'Object')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#get_access_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_account(opts = {}) click to toggle source

Get Account Retrieve account details.
Returns a account object if a valid identifier was provided, and returns an error otherwise.
“` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/account “` @param [Hash] opts the optional parameters @return [Object]

# File lib/dialmycalls_client/api/accounts_api.rb, line 265
def get_account(opts = {})
  data, _status_code, _headers = get_account_with_http_info(opts)
  return data
end
get_account_with_http_info(opts = {}) click to toggle source

Get Account Retrieve account details. &lt;br&gt;&lt;br&gt; Returns a account object if a valid identifier was provided, and returns an error otherwise. &lt;br&gt;&lt;br&gt; &#x60;&#x60;&#x60; curl -i -H "Content-Type: application/json&quot; -X GET $API_KEY@api.dialmycalls.com/2.0/account &#x60;&#x60;&#x60; @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers

# File lib/dialmycalls_client/api/accounts_api.rb, line 274
def get_account_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.get_account ..."
  end
  # resource path
  local_var_path = "/account".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json', 'application/xml']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'application/xml']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  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 => 'Object')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#get_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_access_account_by_id(update_access_account_by_id_parameters, access_account_id, opts = {}) click to toggle source

Update Access Account Update an existing access account.
Returns a access account object if a valid identifier was provided and input validation passed, and returns an error otherwise.
“` curl -i -H "Content-Type: application/json" -X PUT -d "{\"name\": \"New Name\"}" $API_KEY@api.dialmycalls.com/2.0/accessaccount/$ACCESSACCOUNT_ID “` @param update_access_account_by_id_parameters Request body @param access_account_id AccessAccountId @param [Hash] opts the optional parameters @return [Object]

# File lib/dialmycalls_client/api/accounts_api.rb, line 320
def update_access_account_by_id(update_access_account_by_id_parameters, access_account_id, opts = {})
  data, _status_code, _headers = update_access_account_by_id_with_http_info(update_access_account_by_id_parameters, access_account_id, opts)
  return data
end
update_access_account_by_id_with_http_info(update_access_account_by_id_parameters, access_account_id, opts = {}) click to toggle source

Update Access Account Update an existing access account. &lt;br&gt;&lt;br&gt; Returns a access account object if a valid identifier was provided and input validation passed, and returns an error otherwise. &lt;br&gt;&lt;br&gt; &#x60;&#x60;&#x60; curl -i -H "Content-Type: application/json&quot; -X PUT -d "{\&quot;name\&quot;: \&quot;New Name\&quot;}&quot; $API_KEY@api.dialmycalls.com/2.0/accessaccount/$ACCESSACCOUNT_ID &#x60;&#x60;&#x60; @param update_access_account_by_id_parameters Request body @param access_account_id AccessAccountId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers

# File lib/dialmycalls_client/api/accounts_api.rb, line 331
def update_access_account_by_id_with_http_info(update_access_account_by_id_parameters, access_account_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.update_access_account_by_id ..."
  end
  # verify the required parameter 'update_access_account_by_id_parameters' is set
  fail ArgumentError, "Missing the required parameter 'update_access_account_by_id_parameters' when calling AccountsApi.update_access_account_by_id" if update_access_account_by_id_parameters.nil?
  # verify the required parameter 'access_account_id' is set
  fail ArgumentError, "Missing the required parameter 'access_account_id' when calling AccountsApi.update_access_account_by_id" if access_account_id.nil?
  # resource path
  local_var_path = "/accessaccount/{AccessAccountId}".sub('{format}','json').sub('{' + 'AccessAccountId' + '}', access_account_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json', 'application/xml']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'application/xml']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(update_access_account_by_id_parameters)
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Object')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#update_access_account_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end