Class: Basecamp::Services::BoostsService

Inherits:
BaseService show all
Defined in:
lib/basecamp/generated/services/boosts_service.rb

Overview

Service for Boosts operations

Instance Method Summary collapse

Constructor Details

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

Instance Method Details

#create_event_boost(recording_id:, event_id:, content:) ⇒ Hash

Create a boost on a specific event within a recording

Parameters:

  • recording_id (Integer)

    recording id ID

  • event_id (Integer)

    event id ID

  • content (String)

    content

Returns:

  • (Hash)

    response data



69
70
71
72
73
# File 'lib/basecamp/generated/services/boosts_service.rb', line 69

def create_event_boost(recording_id:, event_id:, content:)
  with_operation(service: "boosts", operation: "create_event_boost", is_mutation: true, resource_id: event_id) do
    http_post("/recordings/#{recording_id}/events/#{event_id}/boosts.json", body: compact_params(content: content)).json
  end
end

#create_recording_boost(recording_id:, content:) ⇒ Hash

Create a boost on a recording

Parameters:

  • recording_id (Integer)

    recording id ID

  • content (String)

    content

Returns:

  • (Hash)

    response data



45
46
47
48
49
# File 'lib/basecamp/generated/services/boosts_service.rb', line 45

def create_recording_boost(recording_id:, content:)
  with_operation(service: "boosts", operation: "create_recording_boost", is_mutation: true, resource_id: recording_id) do
    http_post("/recordings/#{recording_id}/boosts.json", body: compact_params(content: content)).json
  end
end

#delete_boost(boost_id:) ⇒ void

This method returns an undefined value.

Delete a boost

Parameters:

  • boost_id (Integer)

    boost id ID



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

def delete_boost(boost_id:)
  with_operation(service: "boosts", operation: "delete_boost", is_mutation: true, resource_id: boost_id) do
    http_delete("/boosts/#{boost_id}")
    nil
  end
end

#get_boost(boost_id:) ⇒ Hash

Get a single boost

Parameters:

  • boost_id (Integer)

    boost id ID

Returns:

  • (Hash)

    response data



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

def get_boost(boost_id:)
  with_operation(service: "boosts", operation: "get_boost", is_mutation: false, resource_id: boost_id) do
    http_get("/boosts/#{boost_id}", operation: "GetBoost").json
  end
end

#list_event_boosts(recording_id:, event_id:, page: nil, max_items: nil) ⇒ ListEnumerator<Hash>

List boosts on a specific event within a recording

Parameters:

  • recording_id (Integer)

    recording id ID

  • event_id (Integer)

    event id ID

  • page (Integer, nil) (defaults to: nil)

    Page number for paginating through results. Defaults to 1. A positive value selects exactly that page, not a starting offset; see SPEC section 8.

  • max_items (Integer, nil) (defaults to: nil)

    cap on items yielded across pages; nil or non-positive means no cap

Returns:

  • (ListEnumerator<Hash>)

    lazily paginated results (#meta carries pagination metadata)



57
58
59
60
61
62
# File 'lib/basecamp/generated/services/boosts_service.rb', line 57

def list_event_boosts(recording_id:, event_id:, page: nil, max_items: nil)
  wrap_paginated(service: "boosts", operation: "list_event_boosts", is_mutation: false, resource_id: event_id) do
    params = compact_query_params(page: page)
    paginate("/recordings/#{recording_id}/events/#{event_id}/boosts.json", params: params, operation: "ListEventBoosts", max_items: max_items)
  end
end

#list_recording_boosts(recording_id:, page: nil, max_items: nil) ⇒ ListEnumerator<Hash>

List boosts on a recording

Parameters:

  • recording_id (Integer)

    recording id ID

  • page (Integer, nil) (defaults to: nil)

    Page number for paginating through results. Defaults to 1. A positive value selects exactly that page, not a starting offset; see SPEC section 8.

  • max_items (Integer, nil) (defaults to: nil)

    cap on items yielded across pages; nil or non-positive means no cap

Returns:

  • (ListEnumerator<Hash>)

    lazily paginated results (#meta carries pagination metadata)



34
35
36
37
38
39
# File 'lib/basecamp/generated/services/boosts_service.rb', line 34

def list_recording_boosts(recording_id:, page: nil, max_items: nil)
  wrap_paginated(service: "boosts", operation: "list_recording_boosts", is_mutation: false, resource_id: recording_id) do
    params = compact_query_params(page: page)
    paginate("/recordings/#{recording_id}/boosts.json", params: params, operation: "ListRecordingBoosts", max_items: max_items)
  end
end