Class: Basecamp::Services::CalendarsService

Inherits:
BaseService
  • Object
show all
Defined in:
lib/basecamp/generated/services/calendars_service.rb

Overview

Service for Calendars operations

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from Basecamp::Services::BaseService

Instance Method Details

#get_calendar(calendar_id:) ⇒ Hash

Get a calendar by its bucket id. A Calendar is a top-level BC5 bucketable

Parameters:

  • calendar_id (Integer)

    calendar id ID

Returns:

  • (Hash)

    response data



13
14
15
16
17
# File 'lib/basecamp/generated/services/calendars_service.rb', line 13

def get_calendar(calendar_id:)
  with_operation(service: "calendars", operation: "get_calendar", is_mutation: false, resource_id: calendar_id) do
    http_get("/calendars/#{calendar_id}", operation: "GetCalendar").json
  end
end

#update_calendar(calendar_id:, calendar:) ⇒ Hash

Update a calendar's display color. An unknown color returns 422 with a JSON

Parameters:

  • calendar_id (Integer)

    calendar id ID

  • calendar (Hash)

    calendar

Returns:

  • (Hash)

    response data



23
24
25
26
27
# File 'lib/basecamp/generated/services/calendars_service.rb', line 23

def update_calendar(calendar_id:, calendar:)
  with_operation(service: "calendars", operation: "update_calendar", is_mutation: true, resource_id: calendar_id) do
    http_put("/calendars/#{calendar_id}", body: compact_params(calendar: calendar)).json
  end
end