Class: Vkit::CLI::Commands::FetchCommand

Inherits:
BaseCommand show all
Defined in:
lib/vkit/cli/commands/fetch_command.rb

Instance Method Summary collapse

Instance Method Details

#call(grant_ref:, format: "json") ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/vkit/cli/commands/fetch_command.rb', line 9

def call(grant_ref:, format: "json")
  with_auth do
    user = credential_store.user
    org  = user["organization_slug"]

    response = authenticated_client.post(
      "/api/v1/orgs/#{org}/grants/#{grant_ref}/fetch",
      body: {}
    )

    rows, meta = normalize_response(response)

    print_result(rows, meta, format)
  end
end