Class: Fizzy::Services::ReactionsService

Inherits:
BaseService show all
Defined in:
lib/fizzy/generated/services/reactions_service.rb

Overview

Service for Reactions operations

Instance Method Summary collapse

Methods inherited from BaseService

#initialize

Constructor Details

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

Instance Method Details

#create_for_card(account_id:, card_number:, content:) ⇒ Hash

create_for_card operation

Parameters:

  • account_id (String)

    account id ID

  • card_number (Integer)

    card number ID

  • content (String)

    content

Returns:

  • (Hash)

    response data



61
62
63
64
65
# File 'lib/fizzy/generated/services/reactions_service.rb', line 61

def create_for_card(account_id:, card_number:, content:)
  with_operation(service: "reactions", operation: "CreateCardReaction", is_mutation: true, resource_id: card_number) do
    http_post("/#{}/cards/#{card_number}/reactions.json", body: compact_params(content: content)).json
  end
end

#create_for_comment(account_id:, card_number:, comment_id:, content:) ⇒ Hash

create_for_comment operation

Parameters:

  • account_id (String)

    account id ID

  • card_number (Integer)

    card number ID

  • comment_id (String)

    comment id ID

  • content (String)

    content

Returns:

  • (Hash)

    response data



27
28
29
30
31
# File 'lib/fizzy/generated/services/reactions_service.rb', line 27

def create_for_comment(account_id:, card_number:, comment_id:, content:)
  with_operation(service: "reactions", operation: "CreateCommentReaction", is_mutation: true, resource_id: comment_id) do
    http_post("/#{}/cards/#{card_number}/comments/#{comment_id}/reactions.json", body: compact_params(content: content)).json
  end
end

#delete_for_card(account_id:, card_number:, reaction_id:) ⇒ void

This method returns an undefined value.

delete_for_card operation

Parameters:

  • account_id (String)

    account id ID

  • card_number (Integer)

    card number ID

  • reaction_id (String)

    reaction id ID



72
73
74
75
76
77
# File 'lib/fizzy/generated/services/reactions_service.rb', line 72

def delete_for_card(account_id:, card_number:, reaction_id:)
  with_operation(service: "reactions", operation: "DeleteCardReaction", is_mutation: true, resource_id: reaction_id) do
    http_delete("/#{}/cards/#{card_number}/reactions/#{reaction_id}")
    nil
  end
end

#delete_for_comment(account_id:, card_number:, comment_id:, reaction_id:) ⇒ void

This method returns an undefined value.

delete_for_comment operation

Parameters:

  • account_id (String)

    account id ID

  • card_number (Integer)

    card number ID

  • comment_id (String)

    comment id ID

  • reaction_id (String)

    reaction id ID



39
40
41
42
43
44
# File 'lib/fizzy/generated/services/reactions_service.rb', line 39

def delete_for_comment(account_id:, card_number:, comment_id:, reaction_id:)
  with_operation(service: "reactions", operation: "DeleteCommentReaction", is_mutation: true, resource_id: reaction_id) do
    http_delete("/#{}/cards/#{card_number}/comments/#{comment_id}/reactions/#{reaction_id}")
    nil
  end
end

#list_for_card(account_id:, card_number:) ⇒ Hash

list_for_card operation

Parameters:

  • account_id (String)

    account id ID

  • card_number (Integer)

    card number ID

Returns:

  • (Hash)

    response data



50
51
52
53
54
# File 'lib/fizzy/generated/services/reactions_service.rb', line 50

def list_for_card(account_id:, card_number:)
  with_operation(service: "reactions", operation: "ListCardReactions", is_mutation: false, resource_id: card_number) do
    http_get("/#{}/cards/#{card_number}/reactions.json").json
  end
end

#list_for_comment(account_id:, card_number:, comment_id:) ⇒ Hash

list_for_comment operation

Parameters:

  • account_id (String)

    account id ID

  • card_number (Integer)

    card number ID

  • comment_id (String)

    comment id ID

Returns:

  • (Hash)

    response data



15
16
17
18
19
# File 'lib/fizzy/generated/services/reactions_service.rb', line 15

def list_for_comment(account_id:, card_number:, comment_id:)
  with_operation(service: "reactions", operation: "ListCommentReactions", is_mutation: false, resource_id: comment_id) do
    http_get("/#{}/cards/#{card_number}/comments/#{comment_id}/reactions.json").json
  end
end