Class: Vatsense::Resources::Sandbox

Inherits:
Object
  • Object
show all
Defined in:
lib/vatsense/resources/sandbox.rb

Overview

Temporary sandbox API keys for testing

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Sandbox

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Sandbox.

Parameters:



31
32
33
# File 'lib/vatsense/resources/sandbox.rb', line 31

def initialize(client:)
  @client = client
end

Instance Method Details

#generate_key(request_options: {}) ⇒ Vatsense::Models::SandboxGenerateKeyResponse

Generate a temporary sandbox API key for testing. Sandbox keys have limited request allowances and restricted endpoint access (no invoice endpoints). Rate limited to 1 key per IP address per 6 hours.

Parameters:

Returns:

See Also:



18
19
20
21
22
23
24
25
26
# File 'lib/vatsense/resources/sandbox.rb', line 18

def generate_key(params = {})
  @client.request(
    method: :post,
    path: "sandbox/key",
    model: Vatsense::Models::SandboxGenerateKeyResponse,
    security: {},
    options: params[:request_options]
  )
end