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
95 96 97 98 99 |
# File 'lib/basecamp/generated/services/schedules_service.rb', line 95 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
56 57 58 59 60 |
# File 'lib/basecamp/generated/services/schedules_service.rb', line 56 def get(schedule_id:) with_operation(service: "schedules", operation: "get", is_mutation: false, resource_id: schedule_id) do http_get("/schedules/#{schedule_id}", operation: "GetSchedule").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}", operation: "GetScheduleEntry").json end end |
#get_entry_occurrence(entry_id:, date:) ⇒ Hash
Get a specific occurrence of a recurring schedule entry
47 48 49 50 51 |
# File 'lib/basecamp/generated/services/schedules_service.rb', line 47 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}", operation: "GetScheduleEntryOccurrence").json end end |
#list_entries(schedule_id:, status: nil) ⇒ Enumerator<Hash>
List entries on a schedule
76 77 78 79 80 81 |
# File 'lib/basecamp/generated/services/schedules_service.rb', line 76 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, operation: "ListScheduleEntries") 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
37 38 39 40 41 |
# File 'lib/basecamp/generated/services/schedules_service.rb', line 37 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
66 67 68 69 70 |
# File 'lib/basecamp/generated/services/schedules_service.rb', line 66 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 |