class PureCloud::PresenceApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

delete_presencedefinition(presence_id, opts = {}) click to toggle source

Delete a Presence Definition

@param presence_id Organization Presence ID @param [Hash] opts the optional parameters @return [nil]

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 32
def delete_presencedefinition(presence_id, opts = {})
  delete_presencedefinition_with_http_info(presence_id, opts)
  return nil
end
delete_presencedefinition_with_http_info(presence_id, opts = {}) click to toggle source

Delete a Presence Definition

@param presence_id Organization Presence ID @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 42
def delete_presencedefinition_with_http_info(presence_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PresenceApi.delete_presencedefinition ..."
  end
  
  
  # verify the required parameter 'presence_id' is set
  fail ArgumentError, "Missing the required parameter 'presence_id' when calling PresenceApi.delete_presencedefinition" if presence_id.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/api/v2/presencedefinitions/{presenceId}".sub('{format}','json').sub('{' + 'presenceId' + '}', presence_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  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']
  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 = ['PureCloud OAuth']
  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: PresenceApi#delete_presencedefinition\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_presencedefinition(presence_id, opts = {}) click to toggle source

Get a Presence Definition

@param presence_id Organization Presence ID @param [Hash] opts the optional parameters @option opts [String] :locale_code The locale code to fetch for the presence definition. Use ALL to fetch everything. @return [OrganizationPresence]

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 97
def get_presencedefinition(presence_id, opts = {})
  data, _status_code, _headers = get_presencedefinition_with_http_info(presence_id, opts)
  return data
end
get_presencedefinition_with_http_info(presence_id, opts = {}) click to toggle source

Get a Presence Definition

@param presence_id Organization Presence ID @param [Hash] opts the optional parameters @option opts [String] :locale_code The locale code to fetch for the presence definition. Use ALL to fetch everything. @return [Array<(OrganizationPresence, Fixnum, Hash)>] OrganizationPresence data, response status code and response headers

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 108
def get_presencedefinition_with_http_info(presence_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PresenceApi.get_presencedefinition ..."
  end
  
  
  # verify the required parameter 'presence_id' is set
  fail ArgumentError, "Missing the required parameter 'presence_id' when calling PresenceApi.get_presencedefinition" if presence_id.nil?
  
  
  
  
  
  
  
  
  
  
  
  # resource path
  local_var_path = "/api/v2/presencedefinitions/{presenceId}".sub('{format}','json').sub('{' + 'presenceId' + '}', presence_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'localeCode'] = opts[:'locale_code'] if opts[:'locale_code']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  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']
  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 = ['PureCloud OAuth']
  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 => 'OrganizationPresence')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PresenceApi#get_presencedefinition\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_presencedefinitions(opts = {}) click to toggle source

Get an Organization's list of Presence Definitions

@param [Hash] opts the optional parameters @option opts [Integer] :page_number Page number (default to 1) @option opts [Integer] :page_size Page size (default to 25) @option opts [String] :deleted Deleted query can be TRUE, FALSE or ALL (default to false) @option opts [String] :locale_code The locale code to fetch for each presence definition. Use ALL to fetch everything. @return [OrganizationPresenceEntityListing]

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 173
def get_presencedefinitions(opts = {})
  data, _status_code, _headers = get_presencedefinitions_with_http_info(opts)
  return data
end
get_presencedefinitions_with_http_info(opts = {}) click to toggle source

Get an Organization&#39;s list of Presence Definitions

@param [Hash] opts the optional parameters @option opts [Integer] :page_number Page number @option opts [Integer] :page_size Page size @option opts [String] :deleted Deleted query can be TRUE, FALSE or ALL @option opts [String] :locale_code The locale code to fetch for each presence definition. Use ALL to fetch everything. @return [Array<(OrganizationPresenceEntityListing, Fixnum, Hash)>] OrganizationPresenceEntityListing data, response status code and response headers

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 186
def get_presencedefinitions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PresenceApi.get_presencedefinitions ..."
  end
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  # resource path
  local_var_path = "/api/v2/presencedefinitions".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']
  query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']
  query_params[:'deleted'] = opts[:'deleted'] if opts[:'deleted']
  query_params[:'localeCode'] = opts[:'locale_code'] if opts[:'locale_code']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  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']
  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 = ['PureCloud OAuth']
  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 => 'OrganizationPresenceEntityListing')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PresenceApi#get_presencedefinitions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_systempresences(opts = {}) click to toggle source

Get the list of SystemPresences

@param [Hash] opts the optional parameters @return [Array<SystemPresence>]

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 260
def get_systempresences(opts = {})
  data, _status_code, _headers = get_systempresences_with_http_info(opts)
  return data
end
get_systempresences_with_http_info(opts = {}) click to toggle source

Get the list of SystemPresences

@param [Hash] opts the optional parameters @return [Array<(Array<SystemPresence>, Fixnum, Hash)>] Array<SystemPresence> data, response status code and response headers

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 269
def get_systempresences_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PresenceApi.get_systempresences ..."
  end
  
  # resource path
  local_var_path = "/api/v2/systempresences".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  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']
  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 = ['PureCloud OAuth']
  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 => 'Array<SystemPresence>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PresenceApi#get_systempresences\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_user_presence(user_id, source_id, opts = {}) click to toggle source

Get a user's Presence Get a user's presence for the specified source that is not specifically listed. Used to support custom presence sources. @param user_id user Id @param source_id Presence source ID @param [Hash] opts the optional parameters @return [UserPresence]

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 317
def get_user_presence(user_id, source_id, opts = {})
  data, _status_code, _headers = get_user_presence_with_http_info(user_id, source_id, opts)
  return data
end
get_user_presence_with_http_info(user_id, source_id, opts = {}) click to toggle source

Get a user&#39;s Presence Get a user&#39;s presence for the specified source that is not specifically listed. Used to support custom presence sources. @param user_id user Id @param source_id Presence source ID @param [Hash] opts the optional parameters @return [Array<(UserPresence, Fixnum, Hash)>] UserPresence data, response status code and response headers

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 328
def get_user_presence_with_http_info(user_id, source_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PresenceApi.get_user_presence ..."
  end
  
  
  # verify the required parameter 'user_id' is set
  fail ArgumentError, "Missing the required parameter 'user_id' when calling PresenceApi.get_user_presence" if user_id.nil?
  
  
  
  
  
  
  # verify the required parameter 'source_id' is set
  fail ArgumentError, "Missing the required parameter 'source_id' when calling PresenceApi.get_user_presence" if source_id.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/api/v2/users/{userId}/presences/{sourceId}".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'sourceId' + '}', source_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  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']
  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 = ['PureCloud OAuth']
  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 => 'UserPresence')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PresenceApi#get_user_presence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_user_presences_microsoftteams(user_id, opts = {}) click to toggle source

Get a user's Microsoft Teams presence. Gets the presence for a Microsoft Teams user. This will return the Microsoft Teams presence mapped to Genesys Cloud presence with additional activity details in the message field. This presence source is read-only. @param user_id user Id @param [Hash] opts the optional parameters @return [PresenceExpand]

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 391
def get_user_presences_microsoftteams(user_id, opts = {})
  data, _status_code, _headers = get_user_presences_microsoftteams_with_http_info(user_id, opts)
  return data
end
get_user_presences_microsoftteams_with_http_info(user_id, opts = {}) click to toggle source

Get a user&#39;s Microsoft Teams presence. Gets the presence for a Microsoft Teams user. This will return the Microsoft Teams presence mapped to Genesys Cloud presence with additional activity details in the message field. This presence source is read-only. @param user_id user Id @param [Hash] opts the optional parameters @return [Array<(PresenceExpand, Fixnum, Hash)>] PresenceExpand data, response status code and response headers

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 401
def get_user_presences_microsoftteams_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PresenceApi.get_user_presences_microsoftteams ..."
  end
  
  
  # verify the required parameter 'user_id' is set
  fail ArgumentError, "Missing the required parameter 'user_id' when calling PresenceApi.get_user_presences_microsoftteams" if user_id.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/api/v2/users/{userId}/presences/microsoftteams".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  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']
  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 = ['PureCloud OAuth']
  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 => 'PresenceExpand')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PresenceApi#get_user_presences_microsoftteams\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_user_presences_purecloud(user_id, opts = {}) click to toggle source

Get a user's Genesys Cloud presence. Get the default Genesys Cloud user presence source PURECLOUD @param user_id user Id @param [Hash] opts the optional parameters @return [UserPresence]

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 456
def get_user_presences_purecloud(user_id, opts = {})
  data, _status_code, _headers = get_user_presences_purecloud_with_http_info(user_id, opts)
  return data
end
get_user_presences_purecloud_with_http_info(user_id, opts = {}) click to toggle source

Get a user&#39;s Genesys Cloud presence. Get the default Genesys Cloud user presence source PURECLOUD @param user_id user Id @param [Hash] opts the optional parameters @return [Array<(UserPresence, Fixnum, Hash)>] UserPresence data, response status code and response headers

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 466
def get_user_presences_purecloud_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PresenceApi.get_user_presences_purecloud ..."
  end
  
  
  # verify the required parameter 'user_id' is set
  fail ArgumentError, "Missing the required parameter 'user_id' when calling PresenceApi.get_user_presences_purecloud" if user_id.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/api/v2/users/{userId}/presences/purecloud".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  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']
  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 = ['PureCloud OAuth']
  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 => 'UserPresence')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PresenceApi#get_user_presences_purecloud\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
patch_user_presence(user_id, source_id, body, opts = {}) click to toggle source

Patch a user's Presence Patch a user's presence for the specified source that is not specifically listed. The presence object can be patched one of three ways. Option 1: Set the 'primary' property to true. This will set the 'source' defined in the path as the user's primary presence source. Option 2: Provide the presenceDefinition value. The 'id' is the only value required within the presenceDefinition. Option 3: Provide the message value. Option 1 can be combined with Option 2 and/or Option 3. @param user_id user Id @param source_id Presence source ID @param body User presence @param [Hash] opts the optional parameters @return [UserPresence]

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 523
def patch_user_presence(user_id, source_id, body, opts = {})
  data, _status_code, _headers = patch_user_presence_with_http_info(user_id, source_id, body, opts)
  return data
end
patch_user_presence_with_http_info(user_id, source_id, body, opts = {}) click to toggle source

Patch a user&#39;s Presence Patch a user&#39;s presence for the specified source that is not specifically listed. The presence object can be patched one of three ways. Option 1: Set the &#39;primary&#39; property to true. This will set the &#39;source&#39; defined in the path as the user&#39;s primary presence source. Option 2: Provide the presenceDefinition value. The &#39;id&#39; is the only value required within the presenceDefinition. Option 3: Provide the message value. Option 1 can be combined with Option 2 and/or Option 3. @param user_id user Id @param source_id Presence source ID @param body User presence @param [Hash] opts the optional parameters @return [Array<(UserPresence, Fixnum, Hash)>] UserPresence data, response status code and response headers

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 535
def patch_user_presence_with_http_info(user_id, source_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PresenceApi.patch_user_presence ..."
  end
  
  
  # verify the required parameter 'user_id' is set
  fail ArgumentError, "Missing the required parameter 'user_id' when calling PresenceApi.patch_user_presence" if user_id.nil?
  
  
  
  
  
  
  # verify the required parameter 'source_id' is set
  fail ArgumentError, "Missing the required parameter 'source_id' when calling PresenceApi.patch_user_presence" if source_id.nil?
  
  
  
  
  
  
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling PresenceApi.patch_user_presence" if body.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/api/v2/users/{userId}/presences/{sourceId}".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'sourceId' + '}', source_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  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']
  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(body)
  
  auth_names = ['PureCloud OAuth']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UserPresence')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PresenceApi#patch_user_presence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
patch_user_presences_purecloud(user_id, body, opts = {}) click to toggle source

Patch a Genesys Cloud user's presence The presence object can be patched one of three ways. Option 1: Set the 'primary' property to true. This will set the PURECLOUD source as the user's primary presence source. Option 2: Provide the presenceDefinition value. The 'id' is the only value required within the presenceDefinition. Option 3: Provide the message value. Option 1 can be combined with Option 2 and/or Option 3. @param user_id user Id @param body User presence @param [Hash] opts the optional parameters @return [UserPresence]

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 607
def patch_user_presences_purecloud(user_id, body, opts = {})
  data, _status_code, _headers = patch_user_presences_purecloud_with_http_info(user_id, body, opts)
  return data
end
patch_user_presences_purecloud_with_http_info(user_id, body, opts = {}) click to toggle source

Patch a Genesys Cloud user&#39;s presence The presence object can be patched one of three ways. Option 1: Set the &#39;primary&#39; property to true. This will set the PURECLOUD source as the user&#39;s primary presence source. Option 2: Provide the presenceDefinition value. The &#39;id&#39; is the only value required within the presenceDefinition. Option 3: Provide the message value. Option 1 can be combined with Option 2 and/or Option 3. @param user_id user Id @param body User presence @param [Hash] opts the optional parameters @return [Array<(UserPresence, Fixnum, Hash)>] UserPresence data, response status code and response headers

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 618
def patch_user_presences_purecloud_with_http_info(user_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PresenceApi.patch_user_presences_purecloud ..."
  end
  
  
  # verify the required parameter 'user_id' is set
  fail ArgumentError, "Missing the required parameter 'user_id' when calling PresenceApi.patch_user_presences_purecloud" if user_id.nil?
  
  
  
  
  
  
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling PresenceApi.patch_user_presences_purecloud" if body.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/api/v2/users/{userId}/presences/purecloud".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  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']
  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(body)
  
  auth_names = ['PureCloud OAuth']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UserPresence')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PresenceApi#patch_user_presences_purecloud\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
post_presencedefinitions(body, opts = {}) click to toggle source

Create a Presence Definition

@param body The Presence Definition to create @param [Hash] opts the optional parameters @return [OrganizationPresence]

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 681
def post_presencedefinitions(body, opts = {})
  data, _status_code, _headers = post_presencedefinitions_with_http_info(body, opts)
  return data
end
post_presencedefinitions_with_http_info(body, opts = {}) click to toggle source

Create a Presence Definition

@param body The Presence Definition to create @param [Hash] opts the optional parameters @return [Array<(OrganizationPresence, Fixnum, Hash)>] OrganizationPresence data, response status code and response headers

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 691
def post_presencedefinitions_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PresenceApi.post_presencedefinitions ..."
  end
  
  
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling PresenceApi.post_presencedefinitions" if body.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/api/v2/presencedefinitions".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  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']
  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(body)
  
  auth_names = ['PureCloud OAuth']
  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 => 'OrganizationPresence')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PresenceApi#post_presencedefinitions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
put_presencedefinition(presence_id, body, opts = {}) click to toggle source

Update a Presence Definition

@param presence_id Organization Presence ID @param body The OrganizationPresence to update @param [Hash] opts the optional parameters @return [OrganizationPresence]

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 747
def put_presencedefinition(presence_id, body, opts = {})
  data, _status_code, _headers = put_presencedefinition_with_http_info(presence_id, body, opts)
  return data
end
put_presencedefinition_with_http_info(presence_id, body, opts = {}) click to toggle source

Update a Presence Definition

@param presence_id Organization Presence ID @param body The OrganizationPresence to update @param [Hash] opts the optional parameters @return [Array<(OrganizationPresence, Fixnum, Hash)>] OrganizationPresence data, response status code and response headers

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 758
def put_presencedefinition_with_http_info(presence_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PresenceApi.put_presencedefinition ..."
  end
  
  
  # verify the required parameter 'presence_id' is set
  fail ArgumentError, "Missing the required parameter 'presence_id' when calling PresenceApi.put_presencedefinition" if presence_id.nil?
  
  
  
  
  
  
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling PresenceApi.put_presencedefinition" if body.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/api/v2/presencedefinitions/{presenceId}".sub('{format}','json').sub('{' + 'presenceId' + '}', presence_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  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']
  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(body)
  
  auth_names = ['PureCloud OAuth']
  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 => 'OrganizationPresence')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PresenceApi#put_presencedefinition\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
put_users_presences_bulk(body, opts = {}) click to toggle source

Update bulk user Presences

@param body List of User presences @param [Hash] opts the optional parameters @return [Array<UserPresence>]

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 821
def put_users_presences_bulk(body, opts = {})
  data, _status_code, _headers = put_users_presences_bulk_with_http_info(body, opts)
  return data
end
put_users_presences_bulk_with_http_info(body, opts = {}) click to toggle source

Update bulk user Presences

@param body List of User presences @param [Hash] opts the optional parameters @return [Array<(Array<UserPresence>, Fixnum, Hash)>] Array<UserPresence> data, response status code and response headers

# File lib/purecloudplatformclientv2/api/presence_api.rb, line 831
def put_users_presences_bulk_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PresenceApi.put_users_presences_bulk ..."
  end
  
  
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling PresenceApi.put_users_presences_bulk" if body.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/api/v2/users/presences/bulk".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  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']
  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(body)
  
  auth_names = ['PureCloud OAuth']
  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 => 'Array<UserPresence>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PresenceApi#put_users_presences_bulk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end