Class: Fizzy::Services::StepsService

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

Overview

Service for Steps 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(account_id:, card_number:, content:, completed: nil) ⇒ Hash

create operation

Parameters:

  • account_id (String)

    account id ID

  • card_number (Integer)

    card number ID

  • content (String)

    content

  • completed (Boolean, nil) (defaults to: nil)

    completed

Returns:

  • (Hash)

    response data



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

def create(account_id:, card_number:, content:, completed: nil)
  with_operation(service: "steps", operation: "CreateStep", is_mutation: true, resource_id: card_number) do
    http_post("/#{}/cards/#{card_number}/steps.json", body: compact_params(content: content, completed: completed)).json
  end
end

#delete(account_id:, card_number:, step_id:) ⇒ void

This method returns an undefined value.

delete operation

Parameters:

  • account_id (String)

    account id ID

  • card_number (Integer)

    card number ID

  • step_id (String)

    step id ID



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

def delete(account_id:, card_number:, step_id:)
  with_operation(service: "steps", operation: "DeleteStep", is_mutation: true, resource_id: step_id) do
    http_delete("/#{}/cards/#{card_number}/steps/#{step_id}")
    nil
  end
end

#get(account_id:, card_number:, step_id:) ⇒ Hash

get operation

Parameters:

  • account_id (String)

    account id ID

  • card_number (Integer)

    card number ID

  • step_id (String)

    step id ID

Returns:

  • (Hash)

    response data



37
38
39
40
41
# File 'lib/fizzy/generated/services/steps_service.rb', line 37

def get(account_id:, card_number:, step_id:)
  with_operation(service: "steps", operation: "GetStep", is_mutation: false, resource_id: step_id) do
    http_get("/#{}/cards/#{card_number}/steps/#{step_id}").json
  end
end

#list(account_id:, card_number:) ⇒ Hash

list operation

Parameters:

  • account_id (String)

    account id ID

  • card_number (Integer)

    card number ID

Returns:

  • (Hash)

    response data



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

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

#update(account_id:, card_number:, step_id:, content: nil, completed: nil) ⇒ Hash

update operation

Parameters:

  • account_id (String)

    account id ID

  • card_number (Integer)

    card number ID

  • step_id (String)

    step id ID

  • content (String, nil) (defaults to: nil)

    content

  • completed (Boolean, nil) (defaults to: nil)

    completed

Returns:

  • (Hash)

    response data



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

def update(account_id:, card_number:, step_id:, content: nil, completed: nil)
  with_operation(service: "steps", operation: "UpdateStep", is_mutation: true, resource_id: step_id) do
    http_patch("/#{}/cards/#{card_number}/steps/#{step_id}", body: compact_params(content: content, completed: completed)).json
  end
end