class DialMyCalls::GroupsApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

create_group(create_group_parameters, opts = {}) click to toggle source

Add Group Add a contact group.
Returns a group object on success, and returns an error otherwise.
“` curl -i -H "Content-Type: application/json" -X POST -d "{\"name\": \"Test Group\"}" $API_KEY@api.dialmycalls.com/2.0/group “` @param create_group_parameters Request body @param [Hash] opts the optional parameters @return [Object]

# File lib/dialmycalls_client/api/groups_api.rb, line 39
def create_group(create_group_parameters, opts = {})
  data, _status_code, _headers = create_group_with_http_info(create_group_parameters, opts)
  return data
end
create_group_with_http_info(create_group_parameters, opts = {}) click to toggle source

Add Group Add a contact group. &lt;br&gt;&lt;br&gt; Returns a group 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;name\&quot;: \&quot;Test Group\&quot;}&quot; $API_KEY@api.dialmycalls.com/2.0/group &#x60;&#x60;&#x60; @param create_group_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/groups_api.rb, line 49
def create_group_with_http_info(create_group_parameters, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi.create_group ..."
  end
  # verify the required parameter 'create_group_parameters' is set
  fail ArgumentError, "Missing the required parameter 'create_group_parameters' when calling GroupsApi.create_group" if create_group_parameters.nil?
  # resource path
  local_var_path = "/group".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_group_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: GroupsApi#create_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_group_by_id(group_id, opts = {}) click to toggle source

Delete Group Delete a contact group.
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/group/$GROUP_ID “` @param group_id GroupId @param [Hash] opts the optional parameters @return [Object]

# File lib/dialmycalls_client/api/groups_api.rb, line 96
def delete_group_by_id(group_id, opts = {})
  data, _status_code, _headers = delete_group_by_id_with_http_info(group_id, opts)
  return data
end
delete_group_by_id_with_http_info(group_id, opts = {}) click to toggle source

Delete Group Delete a contact group. &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/group/$GROUP_ID &#x60;&#x60;&#x60; @param group_id GroupId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers

# File lib/dialmycalls_client/api/groups_api.rb, line 106
def delete_group_by_id_with_http_info(group_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi.delete_group_by_id ..."
  end
  # verify the required parameter 'group_id' is set
  fail ArgumentError, "Missing the required parameter 'group_id' when calling GroupsApi.delete_group_by_id" if group_id.nil?
  # resource path
  local_var_path = "/group/{GroupId}".sub('{format}','json').sub('{' + 'GroupId' + '}', group_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: GroupsApi#delete_group_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_group_by_id(group_id, opts = {}) click to toggle source

Get Group Retrieve a contact group.
Returns a group 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/group/$GROUP_ID “` @param group_id GroupId @param [Hash] opts the optional parameters @return [Object]

# File lib/dialmycalls_client/api/groups_api.rb, line 153
def get_group_by_id(group_id, opts = {})
  data, _status_code, _headers = get_group_by_id_with_http_info(group_id, opts)
  return data
end
get_group_by_id_with_http_info(group_id, opts = {}) click to toggle source

Get Group Retrieve a contact group. &lt;br&gt;&lt;br&gt; Returns a group 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/group/$GROUP_ID &#x60;&#x60;&#x60; @param group_id GroupId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers

# File lib/dialmycalls_client/api/groups_api.rb, line 163
def get_group_by_id_with_http_info(group_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi.get_group_by_id ..."
  end
  # verify the required parameter 'group_id' is set
  fail ArgumentError, "Missing the required parameter 'group_id' when calling GroupsApi.get_group_by_id" if group_id.nil?
  # resource path
  local_var_path = "/group/{GroupId}".sub('{format}','json').sub('{' + 'GroupId' + '}', group_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: GroupsApi#get_group_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_groups(opts = {}) click to toggle source

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

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

List Groups Retrieve a list of contact groups. &lt;br&gt;&lt;br&gt; Returns a list of group 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/groups &#x60;&#x60;&#x60; @param [Hash] opts the optional parameters @option opts [String] :range Range (ie "records&#x3D;201-300&quot;) of groups requested @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers

# File lib/dialmycalls_client/api/groups_api.rb, line 220
def get_groups_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi.get_groups ..."
  end
  # resource path
  local_var_path = "/groups".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: GroupsApi#get_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_group_by_id(update_group_by_id_parameters, group_id, opts = {}) click to toggle source

Update Group Update an existing contact group.
Returns a group 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\": \"Test Group Updated\"}" $API_KEY@api.dialmycalls.com/2.0/group/$GROUP_ID “` @param update_group_by_id_parameters Request body @param group_id GroupId @param [Hash] opts the optional parameters @return [Object]

# File lib/dialmycalls_client/api/groups_api.rb, line 267
def update_group_by_id(update_group_by_id_parameters, group_id, opts = {})
  data, _status_code, _headers = update_group_by_id_with_http_info(update_group_by_id_parameters, group_id, opts)
  return data
end
update_group_by_id_with_http_info(update_group_by_id_parameters, group_id, opts = {}) click to toggle source

Update Group Update an existing contact group. &lt;br&gt;&lt;br&gt; Returns a group 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;Test Group Updated\&quot;}&quot; $API_KEY@api.dialmycalls.com/2.0/group/$GROUP_ID &#x60;&#x60;&#x60; @param update_group_by_id_parameters Request body @param group_id GroupId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers

# File lib/dialmycalls_client/api/groups_api.rb, line 278
def update_group_by_id_with_http_info(update_group_by_id_parameters, group_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi.update_group_by_id ..."
  end
  # verify the required parameter 'update_group_by_id_parameters' is set
  fail ArgumentError, "Missing the required parameter 'update_group_by_id_parameters' when calling GroupsApi.update_group_by_id" if update_group_by_id_parameters.nil?
  # verify the required parameter 'group_id' is set
  fail ArgumentError, "Missing the required parameter 'group_id' when calling GroupsApi.update_group_by_id" if group_id.nil?
  # resource path
  local_var_path = "/group/{GroupId}".sub('{format}','json').sub('{' + 'GroupId' + '}', group_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_group_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: GroupsApi#update_group_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end