Class: Vatsense::Resources::Sandbox
- Inherits:
-
Object
- Object
- Vatsense::Resources::Sandbox
- Defined in:
- lib/vatsense/resources/sandbox.rb
Overview
Temporary sandbox API keys for testing
Instance Method Summary collapse
-
#generate_key(request_options: {}) ⇒ Vatsense::Models::SandboxGenerateKeyResponse
Generate a temporary sandbox API key for testing.
-
#initialize(client:) ⇒ Sandbox
constructor
private
A new instance of Sandbox.
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.
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.
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 |