class StarkBank::Organization

# Organization object The Organization object is an authentication entity for the SDK that represents your entire Organization, being able to access any Workspace underneath it and even create new Workspaces. Only a legal representative of your organization can register or change the Organization credentials. All requests to the Stark Bank API must be authenticated via an SDK user, which must have been previously created at the Stark Bank website

web.sandbox.starkbank.com

or [web.starkbank.com]

before you can use it in this SDK. Organizations may be passed as the user parameter on each request or may be defined as the default user at the start (See README). If you are accessing a specific Workspace using Organization credentials, you should specify the workspace ID when building the Organization object or by request, using the Organization.replace(organization, workspace_id) method, which creates a copy of the organization object with the altered workspace ID. If you are listing or creating new Workspaces, the workspace_id should be nil.

## Parameters (required):

## Attributes (return-only):

Attributes

workspace_id[R]

Public Class Methods

new(id:, environment:, private_key:, workspace_id: nil) click to toggle source
Calls superclass method StarkBank::User::new
# File lib/user/organization.rb, line 32
def initialize(id:, environment:, private_key:, workspace_id: nil)
  super(environment, id, private_key)
  @workspace_id = workspace_id
end
replace(organization, workspace_id) click to toggle source
# File lib/user/organization.rb, line 45
def self.replace(organization, workspace_id)
  Organization.new(
    environment: organization.environment,
    id: organization.id,
    private_key: organization.pem,
    workspace_id: workspace_id
  )
end

Public Instance Methods

access_id() click to toggle source
# File lib/user/organization.rb, line 37
def access_id
  if @workspace_id
    "organization/#{@id}/workspace/#{@workspace_id}"
  else
    "organization/#{@id}"
  end
end