webex_xml_api 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc6439b697c1c55511d7d068eb80998801ea933c
4
- data.tar.gz: 17c74a9dcf533b0af473db71e2c803f6465f9984
3
+ metadata.gz: 3ff45d3c08534dc9ae3f8c07e89ebeeae2f9c677
4
+ data.tar.gz: 38b985ace7c196bafbe9beed8fd20c62e359aee7
5
5
  SHA512:
6
- metadata.gz: 402c5e713cf1be2f30210a39fa37c89bd315bd14180b40eaef268b67ae6e3453d7502eb985f64c6a80886dbebfd4a610bc968f14bfca19daea8b6860ad66855e
7
- data.tar.gz: f73f70f9856cf2c17b04137d93e701b2469bf573dcb7debe50804b8dc86c46a5a7fcc310885e3baeb68a2de0214cb41b47b6cea0ddaf28bee4845a2dd9c2e63c
6
+ metadata.gz: 2b64e12a355b219456277eacee9b7d8675f5d0bd59dba53080a95da6d397362118f93b3547b1eb5beca18d39d4eda0f9c80b03d2bc4897e7a08880c158101987
7
+ data.tar.gz: 4b9aac0d6f9662c52ce361c5d58738380f1136165d484f4948d8b23516cc11fc049920ec0ab45e66e1a090b2538aee99e2a8f292e7b423467dd025356a7b733d
Binary file
data.tar.gz.sig CHANGED
@@ -1 +1,3 @@
1
- ���>��' �������4�UAqw ��$�GTn ] 8Mb�C�1w��Ζ�4��� &P�N��n|{����;�R:�tlZM|6)R���P�Vf�@LEN��ޅE\qp,�PNٓ!.ذj�g��u<� ��
1
+ e��Q2���mA˼[nU5��r2/��R hW�ˣ���s�yBmr��K��/$�.��=w�)I�����j�H�l9��
2
+ ��?��R����[�k���
3
+ ��"~*�*�I�>�9�z��S���g�>���g����� �P�k ��~����K��'�^��=T<V��o�Y�=/���GTj'5J��(�3k �=Z1 -��H�� �h���C �b ���Zz��|�!S�5 ��J|c���[u�m
@@ -3,9 +3,6 @@ AllCops:
3
3
  - 'bin/**/*'
4
4
  - 'webex_xml_api.gemspec'
5
5
 
6
- Documentation:
7
- Enabled: false
8
-
9
6
  Metrics/AbcSize:
10
7
  Enabled: false
11
8
 
data/README.md CHANGED
@@ -48,16 +48,11 @@ To create a WebEx Meeting you need to use **WebexXmlApi::Meeting::CreateMeeting*
48
48
 
49
49
  ```ruby
50
50
  sm = WebexXmlApi::Meeting::CreateMeeting.new(site_name: 'test', webex_id: 'username', password: 'password')
51
- => #<WebexXmlApi::Meeting::CreateMeeting:0x007ff2f99f0a30 @security_context=#<WebexXmlApi::SecurityContext:0x0... (output cut for brevity)
52
- sm.conf_name = 'Name of the Telephone Conference'
53
- => "Name of the Telephone Conference"
54
- sm.agenda = 'Meeting Agenda'
55
- => "Meeting Agenda"
56
- sm.start_date = '07/29/2016 15:00:00' # note the MM/DD/YYYY HH:MM:SS format, or provide a DateTime object
57
- => "07/29/2016 15:00:00"
58
- sm.duration = '30' # in Minutes
59
- => "30"
60
- sm.open_time = '900' # time before the start in seconds where participants can join the meeting
51
+ sm.conf_name = 'Name of the Telephone Conference' # REQUIRED: set the name of your conference
52
+ sm.agenda = 'Meeting Agenda' # OPTIONAL: set the agenda
53
+ sm.start_date = '07/29/2016 15:00:00' # REQUIRED: start time; note the MM/DD/YYYY HH:MM:SS format, or provide a DateTime object
54
+ sm.duration = '30' # REQUIRED: duration in Minutes
55
+ sm.open_time = '900' # OPTIONAL: time before the start in seconds where participants can join the meeting
61
56
  sm.send_request
62
57
  => {"meetingkey"=>"123456789", "iCalendarURL"=>{"host"=>"https://test.webex.com/test/j.php?MTID=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "attendee"=>"https://test.webex.com/test/j.php?MTID=bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"}, "guestToken"=>"cccccccccccccccccccccccccccccccc", "type"=>"meet:createMeetingResponse"}
63
58
  ```
@@ -66,6 +61,11 @@ This will create a very basic meeting for you.
66
61
 
67
62
  Using the **meetingkey** you can retrieve further details of your Meeting (**WebexXmlApi::Meeting::GetMeeting**), get URL for joining the meeting (**WebexXmlApi::Meeting::GetjoinurlMeeting**) or delete it (**WebexXmlApi::Meeting::DelMeeting**).
68
63
 
64
+ WebexXmlApi is throwing Exceptions, make sure you implement `begin..rescue` blocks. Following Exceptions are being raised:
65
+
66
+ * **NotEnoughArguments** - API Method is missing parameters required to fulfill the WebEx request
67
+ * **RequestFailed** - Raised if WebEx API Interface returns an error. The error message sent by the WebEx can be retrieved from the message property and entire response object for debugging purposes is stored in the response propery.
68
+
69
69
  Further usage details can be found in [Wiki Site](https://github.com/erolms/webex_xml_api/wiki) here at GitHub or in the gem documentation.
70
70
 
71
71
  ## Development
@@ -86,7 +86,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/erolms
86
86
 
87
87
  ## License
88
88
 
89
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
89
+ The gem is available as open source under the terms of the [MIT License](https://raw.githubusercontent.com/erolms/webex_xml_api/master/LICENSE.txt).
90
90
 
91
91
  ## Copyrights
92
92
 
@@ -1,13 +1,24 @@
1
1
  module WebexXmlApi
2
+ ##
3
+ # The +Common+ module is a collection of methods used by many other modules
4
+ # and it is being included within those.
5
+ #
2
6
  module Common
3
- # POST request to the WebEx XML Service
7
+ ##
8
+ # The +post_webex_request+ method sends the request to WebEx XML Service.
9
+ #
4
10
  def post_webex_request(site_name, request)
5
11
  endpoint = "https://#{site_name}.webex.com/WBXService/XMLService".freeze
6
12
  HTTParty.post(endpoint, body: request,
7
13
  headers: { 'Content-Type' => 'application/xml' })
8
14
  end
9
15
 
10
- # Check WebEx Response status and raise Exception if FAILURE
16
+ ##
17
+ # The +check_response_and_return_data+ method checks the WebEx Response
18
+ # status and raises <tt>WebexXmlApi::RequestFailed</tt> Exception if status
19
+ # is otherwise than SUCCESS. If the request was successful than the parsed
20
+ # Response Hash is returned.
21
+ #
11
22
  def check_response_and_return_data(resp)
12
23
  status = resp.parsed_response['message']['header']['response']['result']
13
24
  return resp.parsed_response['message']['body']['bodyContent'] if
@@ -17,7 +28,10 @@ module WebexXmlApi
17
28
  raise WebexXmlApi::RequestFailed.new(resp), "Error #{c}: #{t}"
18
29
  end
19
30
 
20
- # Create WebEx XML Request
31
+ ##
32
+ # The +create_xml_request+ method creates a XML formatted document as
33
+ # understood by WebEx XML API Service including the Security Context.
34
+ #
21
35
  def create_xml_request(sec_context, req_type, body_content)
22
36
  namespaces = {
23
37
  'xmlns:serv' => 'http://www.webex.com/schemas/2002/06/service',
@@ -36,7 +50,7 @@ module WebexXmlApi
36
50
  builder.to_xml.gsub(%r{(<\w+\/>)}, '')
37
51
  end
38
52
 
39
- def process_object(label, obj, xml, req_type)
53
+ def process_object(label, obj, xml, req_type) # :nodoc:
40
54
  xml.send(label) do
41
55
  xml.parent['xsi:type'] = req_type if label == 'bodyContent'
42
56
  obj.each do |key, value|
@@ -1,19 +1,20 @@
1
1
  module WebexXmlApi
2
- # @abstact Exceptions raised by WebexXmlApi inherit from Error
2
+ # Exceptions raised by WebexXmlApi inherit from Error
3
3
  class Error < StandardError; end
4
4
 
5
5
  # Exception raised if you do not provide enough arguments for the Request
6
- # Object to be valid
6
+ # Object to be valid.
7
7
  class NotEnoughArguments < Error; end
8
8
 
9
- # @abstract Exception raised if request against WebEx Service failed
9
+ # Exception raised if request against WebEx Service fails
10
+ # Returns the error received by WebEx XML API Service
11
+ # @return [Hash] An object with error code and message
10
12
  class RequestFailed < Error
11
- # Returns the error received by WebEx XML API Service
12
- # @return [Hash] An object with error code and message
13
+ # The reader method for the response object
13
14
  attr_reader :response
14
15
 
15
- # Instantiate an instance of RequestFailed with error Object
16
- # @param [Object] An object with response received by WebEx Service
16
+ # Instantiate an instance of +RequestFailed+ with an error Object
17
+ # @param response [Object] object with response received by WebEx Service
17
18
  def initialize(response)
18
19
  @response ||= response
19
20
  end
@@ -1,67 +1,109 @@
1
1
  module WebexXmlApi
2
2
  module Meeting
3
+ ##
4
+ # The +CreateMeeting+ Class sends a Create Meeting request to the WebEx
5
+ # XML API Service and returns a Hash with the meeting key of the newly
6
+ # created meeting
7
+ #
3
8
  class CreateMeeting
4
9
  include WebexXmlApi::Common
5
10
 
11
+ # XML Request Type for the <tt>WebexXmlApi::Meeting::CreateMeeting</tt>
12
+ # service
6
13
  REQUEST_TYPE =
7
14
  'java:com.webex.service.binding.meeting.CreateMeeting'.freeze
8
15
 
16
+ # Accessor methods for meeting and security_context object
9
17
  attr_accessor :security_context, :meeting
18
+ # Reader methods for request and response objects
10
19
  attr_reader :request, :response
11
20
 
21
+ ##
22
+ # The +initialize+ method for newly created instance parsing provided
23
+ # parameters (if any). The +initialize+ method automaticaly creates
24
+ # new +SecurityContext+ instance and passes the attribes.
25
+ #
12
26
  def initialize(attributes = {})
13
27
  @security_context ||= WebexXmlApi::SecurityContext.new(attributes)
14
28
  @meeting ||= []
15
29
  init_meeting_object
16
30
  end
17
31
 
32
+ ##
33
+ # The +to_xml+ method returns XML representation of the
34
+ # <tt>WebexXmlApi::Meeting::CreateMeeting</tt> instance as understood by
35
+ # the WebEx XML Service.
36
+ #
18
37
  def to_xml
19
38
  raise WebexXmlApi::NotEnoughArguments,
20
39
  'Meeting::CreateMeeting' unless valid?
21
40
  create_xml_request(@security_context.to_xml, REQUEST_TYPE, @meeting)
22
41
  end
23
42
 
43
+ ##
44
+ # Returns true if required parameters provided, otherwise false.
45
+ #
24
46
  def valid?(context = self)
25
47
  return false if context.conf_name.nil?
26
48
  return false if context.start_date.nil? || context.duration.nil?
27
49
  true
28
50
  end
29
51
 
52
+ ##
53
+ # The +send_request+ method will issue the XML API request to WebEx,
54
+ # parse the results and return data if successful. Upon failure an
55
+ # exception is raised.
56
+ #
30
57
  def send_request
31
58
  @request = to_xml
32
59
  @response = post_webex_request(security_context.site_name, @request)
33
60
  check_response_and_return_data(@response)
34
61
  end
35
62
 
36
- # various getters and setter from here
63
+ # ----------------------------------
64
+ # :section: Getter and Setter Methods
65
+ # A selection of getter and setter methods for easier access to the
66
+ # instance variables based on the experience using the WebEx Service.
67
+ # ----------------------------------
68
+
69
+ # The +conf_name+ getter
37
70
  def conf_name
38
71
  @meeting['metaData']['confName']
39
72
  end
40
73
 
74
+ # The +conf_name+ setter
41
75
  def conf_name=(str)
42
76
  @meeting['metaData']['confName'] = str
43
77
  end
44
78
 
79
+ # The +agenda+ getter
45
80
  def agenda
46
81
  @meeting['metaData']['agenda']
47
82
  end
48
83
 
84
+ # The +agenda+ setter
49
85
  def agenda=(str)
50
86
  @meeting['metaData']['agenda'] = str
51
87
  end
52
88
 
89
+ # The +meeting_password+ getter
53
90
  def meeting_password
54
91
  @meeting['accessControl']['meetingPassword']
55
92
  end
56
93
 
94
+ # The +meeting_password+ setter
57
95
  def meeting_password=(str)
58
96
  @meeting['accessControl']['meetingPassword'] = str
59
97
  end
60
98
 
99
+ # The +start_date+ getter
61
100
  def start_date
62
101
  @meeting['schedule']['startDate']
63
102
  end
64
103
 
104
+ # The +start_date+ setter
105
+ # Paremeter provided can be either a String in a MM/DD/YYYY HH:MI:SS
106
+ # format or a DateTime object that is formatted to fit the WebEx format.
65
107
  def start_date=(str)
66
108
  if str.is_a? String
67
109
  @meeting['schedule']['startDate'] = str
@@ -70,88 +112,118 @@ module WebexXmlApi
70
112
  end
71
113
  end
72
114
 
115
+ # The +duration+ getter
73
116
  def duration
74
117
  @meeting['schedule']['duration']
75
118
  end
76
119
 
120
+ # The +duration+ setter
77
121
  def duration=(str)
78
122
  @meeting['schedule']['duration'] = str
79
123
  end
80
124
 
125
+ # The +open_time+ getter
81
126
  def open_time
82
127
  @meeting['schedule']['openTime']
83
128
  end
84
129
 
130
+ # The +open_time+ setter
85
131
  def open_time=(str)
86
132
  @meeting['schedule']['openTime'] = str
87
133
  end
88
134
 
135
+ # The +join_teleconf_before_host+ getter
89
136
  def join_teleconf_before_host
90
137
  @meeting['schedule']['joinTeleconfBeforeHost']
91
138
  end
92
139
 
140
+ # The +join_teleconf_before_host+ setter
93
141
  def join_teleconf_before_host=(str)
94
142
  @meeting['schedule']['joinTeleconfBeforeHost'] = str
95
143
  end
96
144
 
145
+ # The +first_attendee_as_presenter+ getter
97
146
  def first_attendee_as_presenter
98
147
  @meeting['schedule']['firstAttendeeAsPresenter']
99
148
  end
100
149
 
150
+ # The +first_attendee_as_presenter+ setter
101
151
  def first_attendee_as_presenter=(str)
102
152
  @meeting['schedule']['firstAttendeeAsPresenter'] = str
103
153
  end
104
154
 
155
+ # The +telephony_support+ getter
105
156
  def telephony_support
106
157
  @meeting['telephony']['telephonySupport']
107
158
  end
108
159
 
160
+ # The +telephony_support+ setter
109
161
  def telephony_support=(str)
110
162
  @meeting['telephony']['telephonySupport'] = str
111
163
  end
112
164
 
165
+ # The +intl_local_call_in+ getter
113
166
  def intl_local_call_in
114
167
  @meeting['telephony']['intlLocalCallIn']
115
168
  end
116
169
 
170
+ # The +intl_local_call_in+ setter
117
171
  def intl_local_call_in=(str)
118
172
  @meeting['telephony']['intlLocalCallIn'] = str
119
173
  end
120
174
 
175
+ # The +teleconf_location+ getter
121
176
  def teleconf_location
122
177
  @meeting['telephony']['teleconfLocation']
123
178
  end
124
179
 
180
+ # The +teleconf_location+ setter
125
181
  def teleconf_location=(str)
126
182
  @meeting['telephony']['teleconfLocation'] = str
127
183
  end
128
184
 
185
+ # The +is_mp_audio+ getter
129
186
  # rubocop:disable PredicateName
130
187
  def is_mp_audio
131
188
  @meeting['telephony']['isMPAudio']
132
189
  end
133
190
 
191
+ # The +is_mp_audio+ setter
134
192
  def is_mp_audio=(str)
135
193
  @meeting['telephony']['isMPAudio'] = str
136
194
  end
137
195
  # rubocop:enable PredicateName
138
196
 
197
+ # The +enable_chat+ getter
139
198
  def enable_chat
140
199
  @meeting['enableOptions']['chat']
141
200
  end
142
201
 
202
+ # The +enable_chat+ setter
143
203
  def enable_chat=(str)
144
204
  @meeting['enableOptions']['chat'] = str
145
205
  end
146
206
 
207
+ # The +enable_audio_video+ getter
147
208
  def enable_audio_video
148
209
  @meeting['enableOptions']['audioVideo']
149
210
  end
150
211
 
212
+ # The +enable_audio_video+ setter
151
213
  def enable_audio_video=(str)
152
214
  @meeting['enableOptions']['audioVideo'] = str
153
215
  end
154
216
 
217
+ # The +enable_attendee_list+ getter
218
+ def enable_attendee_list
219
+ @meeting['enableOptions']['attendeeList']
220
+ end
221
+
222
+ # The +enable_attendee_list+ setter
223
+ def enable_attendee_list=(str)
224
+ @meeting['enableOptions']['attendeeList'] = str
225
+ end
226
+
155
227
  private
156
228
 
157
229
  def init_meeting_object
@@ -1,16 +1,31 @@
1
1
  module WebexXmlApi
2
2
  module Meeting
3
+ ##
4
+ # The +DekMeeting+ Class sends delete meeting request to the WebEx XML API
5
+ # service
6
+ #
3
7
  class DelMeeting
4
8
  include WebexXmlApi::Common
5
9
 
10
+ # XML Request Type for the <tt>WebexXmlApi::Meeting::DelMeeting</tt>
11
+ # service
6
12
  REQUEST_TYPE = 'java:com.webex.service.binding.meeting.DelMeeting'.freeze
13
+
14
+ # The meeting_key is required parameter for this service
7
15
  PARAMETER_MAPPING = {
8
16
  meeting_key: 'meetingKey'
9
17
  }.freeze
10
18
 
19
+ # Accessor methods for meeting_key property and security_context object
11
20
  attr_accessor :meeting_key, :security_context
21
+ # Reader methods for request and response objects
12
22
  attr_reader :request, :response
13
23
 
24
+ ##
25
+ # The +initialize+ method for newly created instance parsing provided
26
+ # parameters (if any). The +initialize+ method automaticaly creates
27
+ # new +SecurityContext+ instance and passes the attribes.
28
+ #
14
29
  def initialize(attributes = {})
15
30
  attributes.each_pair do |k, v|
16
31
  send("#{k}=", v) if PARAMETER_MAPPING.key?(k)
@@ -18,6 +33,11 @@ module WebexXmlApi
18
33
  @security_context ||= WebexXmlApi::SecurityContext.new(attributes)
19
34
  end
20
35
 
36
+ ##
37
+ # The +to_xml+ method returns XML representation of the
38
+ # <tt>WebexXmlApi::Meeting::DelMeeting</tt> instance as understood by
39
+ # the WebEx XML Service.
40
+ #
21
41
  def to_xml
22
42
  raise WebexXmlApi::NotEnoughArguments,
23
43
  'Meeting::DelMeeting' unless valid?
@@ -29,11 +49,19 @@ module WebexXmlApi
29
49
  body_content)
30
50
  end
31
51
 
52
+ ##
53
+ # Returns true if required parameters provided, otherwise false.
54
+ #
32
55
  def valid?(context = self)
33
56
  return false if context.meeting_key.nil?
34
57
  true
35
58
  end
36
59
 
60
+ ##
61
+ # The +send_request+ method will issue the XML API request to WebEx,
62
+ # parse the results and return data if successful. Upon failure an
63
+ # exception is raised.
64
+ #
37
65
  def send_request
38
66
  @request = to_xml
39
67
  @response = post_webex_request(security_context.site_name, @request)
@@ -1,16 +1,34 @@
1
1
  module WebexXmlApi
2
+ ##
3
+ # The +Meeting+ module encapsulates the WebEx Meeting XML namespace
4
+ #
2
5
  module Meeting
6
+ ##
7
+ # The +GetMeeting+ Class queries WebEx API Service for given meeting_key
8
+ # and returns the meeting details.
9
+ #
3
10
  class GetMeeting
4
11
  include WebexXmlApi::Common
5
12
 
13
+ # XML Request Type for the <tt>WebexXmlApi::Meeting::GetMeeting</tt>
14
+ # service
6
15
  REQUEST_TYPE = 'java:com.webex.service.binding.meeting.GetMeeting'.freeze
16
+
17
+ # The meeting_key is required parameter for this service
7
18
  PARAMETER_MAPPING = {
8
19
  meeting_key: 'meetingKey'
9
20
  }.freeze
10
21
 
22
+ # Accessor methods for meeting_key property and security_context object
11
23
  attr_accessor :meeting_key, :security_context
24
+ # Reader methods for request and response objects
12
25
  attr_reader :request, :response
13
26
 
27
+ ##
28
+ # The +initialize+ method for newly created instance parsing provided
29
+ # parameters (if any). The +initialize+ method automaticaly creates
30
+ # new +SecurityContext+ instance and passes the attribes.
31
+ #
14
32
  def initialize(attributes = {})
15
33
  attributes.each_pair do |k, v|
16
34
  send("#{k}=", v) if PARAMETER_MAPPING.key?(k)
@@ -18,6 +36,11 @@ module WebexXmlApi
18
36
  @security_context ||= WebexXmlApi::SecurityContext.new(attributes)
19
37
  end
20
38
 
39
+ ##
40
+ # The +to_xml+ method returns XML representation of the
41
+ # <tt>WebexXmlApi::Meeting::GetMeeting</tt> instance as understood by
42
+ # the WebEx XML Service.
43
+ #
21
44
  def to_xml
22
45
  raise WebexXmlApi::NotEnoughArguments,
23
46
  'Meeting::GetMeeting' unless valid?
@@ -29,11 +52,19 @@ module WebexXmlApi
29
52
  body_content)
30
53
  end
31
54
 
55
+ ##
56
+ # Returns true if required parameters provided, otherwise false.
57
+ #
32
58
  def valid?(context = self)
33
59
  return false if context.meeting_key.nil?
34
60
  true
35
61
  end
36
62
 
63
+ ##
64
+ # The +send_request+ method will issue the XML API request to WebEx,
65
+ # parse the results and return data if successful. Upon failure an
66
+ # exception is raised.
67
+ #
37
68
  def send_request
38
69
  @request = to_xml
39
70
  @response = post_webex_request(security_context.site_name, @request)
@@ -1,17 +1,32 @@
1
1
  module WebexXmlApi
2
2
  module Meeting
3
+ ##
4
+ # The +GetjoinurlMeeting+ Class queries WebEx API Service for given
5
+ # session_key (meeting key) and returns a Hash with WebEx Join URL
6
+ #
3
7
  class GetjoinurlMeeting
4
8
  include WebexXmlApi::Common
5
9
 
10
+ # XML Request Type for the
11
+ # <tt>WebexXmlApi::Meeting::GetjoinurlMeeting</tt> service
6
12
  REQUEST_TYPE =
7
13
  'java:com.webex.service.binding.meeting.GetjoinurlMeeting'.freeze
14
+
15
+ # The session_key is required parameter for this service
8
16
  PARAMETER_MAPPING = {
9
17
  session_key: 'sessionKey'
10
18
  }.freeze
11
19
 
20
+ # Accessor methods for session_key property and security_context object
12
21
  attr_accessor :session_key, :security_context
22
+ # Reader methods for request and response objects
13
23
  attr_reader :request, :response
14
24
 
25
+ ##
26
+ # The +initialize+ method for newly created instance parsing provided
27
+ # parameters (if any). The +initialize+ method automaticaly creates
28
+ # new +SecurityContext+ instance and passes the attribes.
29
+ #
15
30
  def initialize(attributes = {})
16
31
  attributes.each_pair do |k, v|
17
32
  send("#{k}=", v) if PARAMETER_MAPPING.key?(k)
@@ -19,6 +34,11 @@ module WebexXmlApi
19
34
  @security_context ||= WebexXmlApi::SecurityContext.new(attributes)
20
35
  end
21
36
 
37
+ ##
38
+ # The +to_xml+ method returns XML representation of the
39
+ # <tt>WebexXmlApi::Meeting::GetjoinurlMeeting</tt> instance as understood
40
+ # by the WebEx XML Service.
41
+ #
22
42
  def to_xml
23
43
  raise WebexXmlApi::NotEnoughArguments,
24
44
  'Meeting::GetjoinurlMeeting' unless valid?
@@ -30,11 +50,19 @@ module WebexXmlApi
30
50
  body_content)
31
51
  end
32
52
 
53
+ ##
54
+ # Returns true if required parameters provided, otherwise false.
55
+ #
33
56
  def valid?(context = self)
34
57
  return false if context.session_key.nil?
35
58
  true
36
59
  end
37
60
 
61
+ ##
62
+ # The +send_request+ method will issue the XML API request to WebEx,
63
+ # parse the results and return data if successful. Upon failure an
64
+ # exception is raised.
65
+ #
38
66
  def send_request
39
67
  @request = to_xml
40
68
  @response = post_webex_request(security_context.site_name, @request)
@@ -1,5 +1,10 @@
1
1
  module WebexXmlApi
2
+ ##
3
+ # SecurityContext class is shared among other API calls and is providing
4
+ # the WebEx XML API Service with user credentials for authentification.
5
+ #
2
6
  class SecurityContext
7
+ # Allowed parameters in the SecurityContext class.
3
8
  PARAMETER_MAPPING = {
4
9
  webex_id: 'webExID',
5
10
  password: 'password',
@@ -14,12 +19,20 @@ module WebexXmlApi
14
19
 
15
20
  PARAMETER_MAPPING.each_key { |k| attr_accessor k }
16
21
 
22
+ ##
23
+ # The +initialize+ method for newly created instance parsing provided
24
+ # parameters (if any).
25
+ #
17
26
  def initialize(attributes = {})
18
27
  attributes.each_pair do |k, v|
19
28
  send("#{k}=", v) if PARAMETER_MAPPING.key?(k)
20
29
  end
21
30
  end
22
31
 
32
+ ##
33
+ # The +to_xml+ method returns XML representation of the
34
+ # <tt>SecurityContext</tt> instance as understood by the WebEx XML Service.
35
+ #
23
36
  def to_xml
24
37
  raise WebexXmlApi::NotEnoughArguments, 'SecurityContext' unless valid?
25
38
  builder = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
@@ -34,6 +47,11 @@ module WebexXmlApi
34
47
  builder.to_xml.gsub("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n", '')
35
48
  end
36
49
 
50
+ ##
51
+ # Returns true if required parameters provided, otherwise false.
52
+ # Parameters :site_name and :webex_id are required.
53
+ # One of the parameters :password or :session_ticket are required too.
54
+ #
37
55
  def valid?(context = self)
38
56
  return false if context.site_name.nil? || context.webex_id.nil?
39
57
  return false if context.password.nil? && context.session_ticket.nil?
@@ -1,16 +1,33 @@
1
1
  module WebexXmlApi
2
+ ##
3
+ # The +User+ module of the API
4
+ #
2
5
  module User
6
+ ##
7
+ # The +GetUser+ Class queries WebEx API Service for given WebEx User ID
8
+ # and returns the details of the User configuration
9
+ #
3
10
  class GetUser
4
11
  include WebexXmlApi::Common
5
12
 
13
+ # XML Request Type for the <tt>WebexXmlApi::User::GetUser</tt> service
6
14
  REQUEST_TYPE = 'java:com.webex.service.binding.user.GetUser'.freeze
15
+
16
+ # The webex_id is required parameter for this service
7
17
  PARAMETER_MAPPING = {
8
18
  webex_id: 'webExId'
9
19
  }.freeze
10
20
 
21
+ # Accessor methods for the webex_id property and security_context object
11
22
  attr_accessor :webex_id, :security_context
23
+ # Reader methods for request and response objects
12
24
  attr_reader :request, :response
13
25
 
26
+ ##
27
+ # The +initialize+ method for newly created instance parsing provided
28
+ # parameters (if any). The +initialize+ method automaticaly creates
29
+ # new +SecurityContext+ instance and passes the attribes.
30
+ #
14
31
  def initialize(attributes = {})
15
32
  attributes.each_pair do |k, v|
16
33
  send("#{k}=", v) if PARAMETER_MAPPING.key?(k)
@@ -18,6 +35,11 @@ module WebexXmlApi
18
35
  @security_context ||= WebexXmlApi::SecurityContext.new(attributes)
19
36
  end
20
37
 
38
+ ##
39
+ # The +to_xml+ method returns XML representation of the
40
+ # <tt>WebexXmlApi::User::GetUser</tt> instance as understood by
41
+ # the WebEx XML Service.
42
+ #
21
43
  def to_xml
22
44
  raise WebexXmlApi::NotEnoughArguments, 'User::GetUser' unless valid?
23
45
  body_content = {}
@@ -28,11 +50,19 @@ module WebexXmlApi
28
50
  body_content)
29
51
  end
30
52
 
53
+ ##
54
+ # Returns true if required parameters provided, otherwise false.
55
+ #
31
56
  def valid?(context = self)
32
57
  return false if context.webex_id.nil?
33
58
  true
34
59
  end
35
60
 
61
+ ##
62
+ # The +send_request+ method will issue the XML API request to WebEx,
63
+ # parse the results and return data if successful. Upon failure an
64
+ # exception is raised.
65
+ #
36
66
  def send_request
37
67
  @request = to_xml
38
68
  @response = post_webex_request(security_context.site_name, @request)
@@ -1,3 +1,7 @@
1
+ ##
2
+ # The +WebexXmlApi+ moduke
3
+ #
1
4
  module WebexXmlApi
2
- VERSION = '0.1.0'.freeze
5
+ # Gem vesion
6
+ VERSION = '0.1.1'.freeze
3
7
  end
@@ -109,6 +109,7 @@ describe WebexXmlApi::Meeting::CreateMeeting do
109
109
  expect(sm.is_mp_audio = 'tst').to eql(sm.is_mp_audio)
110
110
  expect(sm.enable_chat = 'tst').to eql(sm.enable_chat)
111
111
  expect(sm.enable_audio_video = 'tst').to eql(sm.enable_audio_video)
112
+ expect(sm.enable_attendee_list = 'tst').to eql(sm.enable_attendee_list)
112
113
  end
113
114
  end
114
115
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webex_xml_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erol Zavidic
@@ -30,7 +30,7 @@ cert_chain:
30
30
  IDTbBxqvlx+U6M7GX9uKycRxR3P7dvOQ30p888C7crtRRmxvBl2wE/fmHiK4gQ17
31
31
  NREDtx+Bo3lOQwgUmOzofKQbE/vo0DRKogbZiCj30IY=
32
32
  -----END CERTIFICATE-----
33
- date: 2016-07-29 00:00:00.000000000 Z
33
+ date: 2016-08-22 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: httparty
metadata.gz.sig CHANGED
Binary file