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



63
64
65
66
67
# File 'lib/basecamp/generated/services/boosts_service.rb', line 63

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



42
43
44
45
46
# File 'lib/basecamp/generated/services/boosts_service.rb', line 42

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}").json
  end
end

#list_event_boosts(recording_id:, event_id:) ⇒ Enumerator<Hash>

List boosts on a specific event within a recording

Parameters:

  • recording_id (Integer)

    recording id ID

  • event_id (Integer)

    event id ID

Returns:

  • (Enumerator<Hash>)

    paginated results



52
53
54
55
56
# File 'lib/basecamp/generated/services/boosts_service.rb', line 52

def list_event_boosts(recording_id:, event_id:)
  wrap_paginated(service: "boosts", operation: "list_event_boosts", is_mutation: false, resource_id: event_id) do
    paginate("/recordings/#{recording_id}/events/#{event_id}/boosts.json")
  end
end

#list_recording_boosts(recording_id:) ⇒ Enumerator<Hash>

List boosts on a recording

Parameters:

  • recording_id (Integer)

    recording id ID

Returns:

  • (Enumerator<Hash>)

    paginated results



32
33
34
35
36
# File 'lib/basecamp/generated/services/boosts_service.rb', line 32

def list_recording_boosts(recording_id:)
  wrap_paginated(service: "boosts", operation: "list_recording_boosts", is_mutation: false, resource_id: recording_id) do
    paginate("/recordings/#{recording_id}/boosts.json")
  end
end