Class: Swiftner::API::Meeting
- Defined in:
- lib/swiftner/API/meeting.rb
Overview
Represents a Meeting service responsible for finding, creating, and deleting spaces. Inherits from the Service class. Provides methods for interacting with meetings.
Constant Summary collapse
- REQUIRED_ATTRIBUTES =
%i[space_id language].freeze
Instance Attribute Summary
Attributes inherited from Service
Class Method Summary collapse
-
.create(attributes) ⇒ Swiftner::API::Meeting
Creates a meeting.
-
.find(meeting_id) ⇒ Swiftner::API::Meeting
Finds meeting by id.
-
.find_meetings ⇒ Array<Swiftner::API::Meeting>
Finds all meetings.
Instance Method Summary collapse
-
#delete ⇒ Hash
Deletes a meeting.
-
#end ⇒ Swiftner::API::Meeting
Ends a meeting.
-
#pause ⇒ Swiftner::API::Meeting?
Pauses a meeting.
-
#resume ⇒ Swiftner::API::Meeting
Resumes a meeting.
-
#start ⇒ Swiftner::API::Meeting
Starts a meeting.
-
#update(attributes) ⇒ Swiftner::API::Meeting
Updates a meeting.
Methods inherited from Service
build, client, #initialize, map_collection, validate_required
Constructor Details
This class inherits a constructor from Swiftner::API::Service
Class Method Details
.create(attributes) ⇒ Swiftner::API::Meeting
Creates a meeting.
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/swiftner/API/meeting.rb', line 37 def self.create(attributes) validate_required(attributes, *REQUIRED_ATTRIBUTES) response = client.post( "/meeting/create", body: attributes.to_json, headers: { "Content-Type" => "application/json" } ) build(response.parsed_response) end |
.find(meeting_id) ⇒ Swiftner::API::Meeting
Finds meeting by id
20 21 22 23 |
# File 'lib/swiftner/API/meeting.rb', line 20 def self.find(meeting_id) response = client.get("/meeting/get/#{meeting_id}") build(response.parsed_response) end |
.find_meetings ⇒ Array<Swiftner::API::Meeting>
Finds all meetings
12 13 14 15 |
# File 'lib/swiftner/API/meeting.rb', line 12 def self.find_meetings response = client.get("/meeting/get-meetings") map_collection(response) end |
Instance Method Details
#delete ⇒ Hash
Deletes a meeting.
122 123 124 |
# File 'lib/swiftner/API/meeting.rb', line 122 def delete client.delete("/meeting/delete/#{id}") end |
#end ⇒ Swiftner::API::Meeting
Ends a meeting
63 64 65 66 67 68 69 70 |
# File 'lib/swiftner/API/meeting.rb', line 63 def end response = client.post( "/meeting/#{id}/end", headers: { "Content-Type" => "application/json" } ) @details = response.parsed_response self end |
#pause ⇒ Swiftner::API::Meeting?
Pauses a meeting
74 75 76 77 78 79 80 81 |
# File 'lib/swiftner/API/meeting.rb', line 74 def pause response = client.post( "/meeting/#{id}/pause", headers: { "Content-Type" => "application/json" } ) @details = response.parsed_response self end |
#resume ⇒ Swiftner::API::Meeting
Resumes a meeting
85 86 87 88 89 90 91 92 |
# File 'lib/swiftner/API/meeting.rb', line 85 def resume response = client.post( "/meeting/#{id}/resume", headers: { "Content-Type" => "application/json" } ) @details = response.parsed_response self end |
#start ⇒ Swiftner::API::Meeting
Starts a meeting
51 52 53 54 55 56 57 58 59 |
# File 'lib/swiftner/API/meeting.rb', line 51 def start response = client.post( "/meeting/#{id}/start", headers: { "Content-Type" => "application/json" } ) @details = response self end |
#update(attributes) ⇒ Swiftner::API::Meeting
Updates a meeting.
106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/swiftner/API/meeting.rb', line 106 def update(attributes) attributes = attributes.transform_keys(&:to_s) @details = @details.merge(attributes) self.class.validate_required(@details, :language, :space) client.put( "/meeting/update/#{id}", body: @details.to_json, headers: { "Content-Type" => "application/json" } ) self end |