Class: Sunspot4R::SystemServiceClient

Inherits:
BaseSunspotServiceClient show all
Defined in:
lib/sunspot4r/system_service_client.rb

Overview

System services allow you to retrieve system level information via the Sunspot layer.

Instance Attribute Summary

Attributes inherited from BaseSunspotServiceClient

#base_uri

Instance Method Summary collapse

Constructor Details

#initialize(base_url = 'https://live-sunspot.connect.daxko.com/Live', options = {}) ⇒ SystemServiceClient

Returns a new instance of SystemServiceClient.



14
15
16
# File 'lib/sunspot4r/system_service_client.rb', line 14

def initialize(base_url = 'https://live-sunspot.connect.daxko.com/Live', options = {})
  super base_url, options
end

Instance Method Details

#get_available_association_for_user(guid) ⇒ Object



175
176
177
178
179
180
# File 'lib/sunspot4r/system_service_client.rb', line 175

def get_available_association_for_user(guid)
  response = call :get_available_association_for_user do |soap|
    soap.body = {"wsdl:userGuid" => guid}
  end
  response.to_hash[:get_available_association_for_user_response][:get_available_association_for_user_result]
end

#get_available_customers_for_userObject

Returns an array of the customer objects available for the logged in user.

Response body XML:

true true Parent_Guid 09c74df3-fc70-4714-abb8-abd10917ba20 Parent_Name ARC Solutions, Inc. Parent_Type Reseller Reseller_Guid 09c74df3-fc70-4714-abb8-abd10917ba20 Reseller_Type Reseller Reseller_Name ARC Solutions, Inc. IsDeleted false CreatedBy_Guid 0d1053c3-4118-48ae-8e4c-860563972a66 CreatedBy_Type User CreatedBy_Name User, Test CreatedDate 2006-12-19T10:24:45-05:00 LastModifiedBy_Guid 0d1053c3-4118-48ae-8e4c-860563972a66 LastModifiedBy_Type User LastModifiedBy_Name User, Test LastModifiedDate 2007-01-30T17:49:43-05:00 SystemModstamp 2007-01-30T17:49:43-05:00 Guid 09d91c93-0cc8-4a00-a676-d1068dfc43d3 Name ARC Solutions, Inc. Locked true ExistsInRepository true RepositoryKey 1 ARC.Polaris.Domain.Core.Sys ResellerDomainObject AggregateDomainObject DomainObject Customer true


151
152
153
154
# File 'lib/sunspot4r/system_service_client.rb', line 151

def get_available_customers_for_user
  response = call :get_available_customers_for_user
  response.to_hash[:get_available_customers_for_user_response][:get_available_customers_for_user_result]
end

#get_sunspot_uri(association_guid) ⇒ Object

Returns a URL constant for the Sunspot instance that is responsible for actions against the given Association.

Response body XML:

true https://live-sunspot.connect.daxko.com/Live


33
34
35
36
37
38
# File 'lib/sunspot4r/system_service_client.rb', line 33

def get_sunspot_uri(association_guid)
  response = call :get_sunspot_uri! do |soap|
    soap.body = {'wsdl:associationGuid' => association_guid}
  end
  response.to_hash[:get_sunspot_uri_response][:get_sunspot_uri_result]
end

#get_versionObject

Returns version info for sunspot Response body XML: <a:ApiFaults xmlns:b="http://schemas.datacontract.org/2004/07/ARC.Polaris.Common.API&quot;/&gt; <a:Errors xmlns:b="http://schemas.datacontract.org/2004/07/ARC.Polaris.Common.Types&quot;/&gt; <a:Exception i:nil="true" xmlns:b="http://schemas.datacontract.org/2004/07/System&quot;/&gt; <a:Success>true</a:Success> <a:Build>548</a:Build> <a:MajorVersion>2008</a:MajorVersion> <a:MinorVersion>4</a:MinorVersion> <a:Revision>2</a:Revision>



170
171
172
173
# File 'lib/sunspot4r/system_service_client.rb', line 170

def get_version
  response = call :get_sunspot_version
  response.to_hash[:get_sunspot_version_response][:get_sunspot_version_result]
end

#service_nameObject

Name of the Sunspot service. Used to build SOAPAction URLs dynamically.



10
11
12
# File 'lib/sunspot4r/system_service_client.rb', line 10

def service_name
  'SystemService'
end