class WebexXmlApi::User::GetUser

The GetUser Class queries WebEx API Service for given WebEx User ID and returns the details of the User configuration

Constants

PARAMETER_MAPPING

The webex_id is required parameter for this service

REQUEST_TYPE

XML Request Type for the WebexXmlApi::User::GetUser service

Attributes

request[R]

Reader methods for request and response objects

response[R]

Reader methods for request and response objects

security_context[RW]

Accessor methods for the webex_id property and security_context object

webex_id[RW]

Accessor methods for the webex_id property and security_context object

Public Class Methods

new(attributes = {}) click to toggle source

The initialize method for newly created instance parsing provided parameters (if any). The initialize method automaticaly creates new SecurityContext instance and passes the attribes.

# File lib/webex_xml_api/user/get_user.rb, line 31
def initialize(attributes = {})
  attributes.each_pair do |k, v|
    send("#{k}=", v) if PARAMETER_MAPPING.key?(k)
  end
  @security_context ||= WebexXmlApi::SecurityContext.new(attributes)
end

Public Instance Methods

send_request() click to toggle source

The send_request method will issue the XML API request to WebEx, parse the results and return data if successful. Upon failure an exception is raised.

# File lib/webex_xml_api/user/get_user.rb, line 66
def send_request
  @request = to_xml
  @response = post_webex_request(security_context.site_name, @request)
  check_response_and_return_data(@response)
end
to_xml() click to toggle source

The to_xml method returns XML representation of the WebexXmlApi::User::GetUser instance as understood by the WebEx XML Service.

# File lib/webex_xml_api/user/get_user.rb, line 43
def to_xml
  raise WebexXmlApi::NotEnoughArguments, 'User::GetUser' unless valid?
  body_content = {}
  PARAMETER_MAPPING.each_pair do |k, v|
    body_content[v] = send(k) if send(k)
  end
  create_xml_request(@security_context.to_xml, REQUEST_TYPE,
                     body_content)
end
valid?(context = self) click to toggle source

Returns true if required parameters provided, otherwise false.

# File lib/webex_xml_api/user/get_user.rb, line 56
def valid?(context = self)
  return false if context.webex_id.nil?
  true
end