Class: Basecamp::Services::SchedulesService
- Inherits:
-
BaseService
- Object
- BaseService
- Basecamp::Services::SchedulesService
- Defined in:
- lib/basecamp/generated/services/schedules_service.rb
Overview
Service for Schedules operations
Instance Method Summary collapse
-
#create_entry(schedule_id:, summary:, starts_at:, ends_at:, description: nil, participant_ids: nil, all_day: nil, notify: nil, subscriptions: nil, visible_to_clients: nil) ⇒ Hash
Create a new schedule entry.
-
#get(schedule_id:) ⇒ Hash
Get a schedule.
-
#get_entry(entry_id:) ⇒ Hash
Get a single schedule entry by id.
-
#get_entry_occurrence(entry_id:, date:) ⇒ Hash
Get a specific occurrence of a recurring schedule entry.
-
#list_entries(schedule_id:, status: nil) ⇒ Enumerator<Hash>
List entries on a schedule.
-
#update_entry(entry_id:, summary: nil, starts_at: nil, ends_at: nil, description: nil, participant_ids: nil, all_day: nil, notify: nil) ⇒ Hash
Update an existing schedule entry.
-
#update_settings(schedule_id:, include_due_assignments:) ⇒ Hash
Update schedule settings.
Constructor Details
This class inherits a constructor from Basecamp::Services::BaseService
Instance Method Details
#create_entry(schedule_id:, summary:, starts_at:, ends_at:, description: nil, participant_ids: nil, all_day: nil, notify: nil, subscriptions: nil, visible_to_clients: nil) ⇒ Hash
Create a new schedule entry
87 88 89 90 91 |
# File 'lib/basecamp/generated/services/schedules_service.rb', line 87 def create_entry(schedule_id:, summary:, starts_at:, ends_at:, description: nil, participant_ids: nil, all_day: nil, notify: nil, subscriptions: nil, visible_to_clients: nil) with_operation(service: "schedules", operation: "create_entry", is_mutation: true, resource_id: schedule_id) do http_post("/schedules/#{schedule_id}/entries.json", body: compact_params(summary: summary, starts_at: starts_at, ends_at: ends_at, description: description, participant_ids: participant_ids, all_day: all_day, notify: notify, subscriptions: subscriptions, visible_to_clients: visible_to_clients)).json end end |
#get(schedule_id:) ⇒ Hash
Get a schedule
48 49 50 51 52 |
# File 'lib/basecamp/generated/services/schedules_service.rb', line 48 def get(schedule_id:) with_operation(service: "schedules", operation: "get", is_mutation: false, resource_id: schedule_id) do http_get("/schedules/#{schedule_id}").json end end |
#get_entry(entry_id:) ⇒ Hash
Get a single schedule entry by id.
13 14 15 16 17 |
# File 'lib/basecamp/generated/services/schedules_service.rb', line 13 def get_entry(entry_id:) with_operation(service: "schedules", operation: "get_entry", is_mutation: false, resource_id: entry_id) do http_get("/schedule_entries/#{entry_id}").json end end |
#get_entry_occurrence(entry_id:, date:) ⇒ Hash
Get a specific occurrence of a recurring schedule entry
39 40 41 42 43 |
# File 'lib/basecamp/generated/services/schedules_service.rb', line 39 def get_entry_occurrence(entry_id:, date:) with_operation(service: "schedules", operation: "get_entry_occurrence", is_mutation: false, resource_id: entry_id) do http_get("/schedule_entries/#{entry_id}/occurrences/#{date}").json end end |
#list_entries(schedule_id:, status: nil) ⇒ Enumerator<Hash>
List entries on a schedule
68 69 70 71 72 73 |
# File 'lib/basecamp/generated/services/schedules_service.rb', line 68 def list_entries(schedule_id:, status: nil) wrap_paginated(service: "schedules", operation: "list_entries", is_mutation: false, resource_id: schedule_id) do params = compact_query_params(status: status) paginate("/schedules/#{schedule_id}/entries.json", params: params) end end |
#update_entry(entry_id:, summary: nil, starts_at: nil, ends_at: nil, description: nil, participant_ids: nil, all_day: nil, notify: nil) ⇒ Hash
Update an existing schedule entry
29 30 31 32 33 |
# File 'lib/basecamp/generated/services/schedules_service.rb', line 29 def update_entry(entry_id:, summary: nil, starts_at: nil, ends_at: nil, description: nil, participant_ids: nil, all_day: nil, notify: nil) with_operation(service: "schedules", operation: "update_entry", is_mutation: true, resource_id: entry_id) do http_put("/schedule_entries/#{entry_id}", body: compact_params(summary: summary, starts_at: starts_at, ends_at: ends_at, description: description, participant_ids: participant_ids, all_day: all_day, notify: notify)).json end end |
#update_settings(schedule_id:, include_due_assignments:) ⇒ Hash
Update schedule settings
58 59 60 61 62 |
# File 'lib/basecamp/generated/services/schedules_service.rb', line 58 def update_settings(schedule_id:, include_due_assignments:) with_operation(service: "schedules", operation: "update_settings", is_mutation: true, resource_id: schedule_id) do http_put("/schedules/#{schedule_id}", body: compact_params(include_due_assignments: include_due_assignments)).json end end |