Class: Devcal::Client
- Inherits:
-
Object
- Object
- Devcal::Client
- Defined in:
- lib/devcal.rb
Overview
The Client class provides methods to interact with the Devcal service.
Direct Known Subclasses
Instance Method Summary collapse
-
#delete_event(**params) ⇒ Object
Deletes an event from the Devcal service.
-
#get_event(**params) ⇒ Object
Retrieves an event from the Devcal service.
-
#insert_event(**params) ⇒ Object
Inserts an event into the Devcal service.
-
#list_events(**params) ⇒ Object
Lists events from the Devcal service.
-
#update_event(**params) ⇒ Object
Updates an event in the Devcal service.
Instance Method Details
#delete_event(**params) ⇒ Object
Deletes an event from the Devcal service.
55 56 57 |
# File 'lib/devcal.rb', line 55 def delete_event(**params) @stub.delete_event(::Devcal::DeleteEventParams.new(params), **@call_opts) end |
#get_event(**params) ⇒ Object
Retrieves an event from the Devcal service.
27 28 29 |
# File 'lib/devcal.rb', line 27 def get_event(**params) @stub.get_event(::Devcal::GetEventParams.new(params), **@call_opts) end |
#insert_event(**params) ⇒ Object
Inserts an event into the Devcal service.
18 19 20 21 |
# File 'lib/devcal.rb', line 18 def insert_event(**params) params[:props] = Google::Protobuf::Struct.from_hash(params[:props]) if params[:props] @stub.insert_event(::Devcal::InsertEventParams.new(params), **@call_opts) end |
#list_events(**params) ⇒ Object
Lists events from the Devcal service.
35 36 37 38 39 40 |
# File 'lib/devcal.rb', line 35 def list_events(**params) list_event_params = {} list_event_params[:range] = ::Devcal::ListEventsRange.new(date: params[:date], period: params[:period]) if params[:date] && params[:period] list_event_params[:props] = Google::Protobuf::Struct.from_hash(params[:props]) if params[:props] @stub.list_events(::Devcal::ListEventsParams.new(list_event_params), **@call_opts) end |
#update_event(**params) ⇒ Object
Updates an event in the Devcal service.
46 47 48 49 |
# File 'lib/devcal.rb', line 46 def update_event(**params) params[:props] = Google::Protobuf::Struct.from_hash(params[:props]) if params[:props] @stub.update_event(::Devcal::UpdateEventParams.new(params), **@call_opts) end |