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
Reader methods for request and response objects
Reader methods for request and response objects
Accessor methods for the webex_id
property and security_context
object
Accessor methods for the webex_id
property and security_context
object
Public Class Methods
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
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
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
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