api_keys

package
v0.0.1-beta.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiKeysService

type ApiKeysService struct {
	// contains filtered or unexported fields
}

func NewApiKeysService

func NewApiKeysService(c *client.Client) *ApiKeysService

func (*ApiKeysService) CreateApikey

func (s *ApiKeysService) CreateApikey(ctx context.Context, merchantCode string, body CreateApikeyBody) (*Apikey, error)

CreateApikey: Create an API key Creates a new API key for the user.

func (*ApiKeysService) GetApikey

func (s *ApiKeysService) GetApikey(ctx context.Context, merchantCode string, keyId string) (*Apikey, error)

GetApikey: Retrieve an API Key Gets an API key.

func (*ApiKeysService) ListApikeys

func (s *ApiKeysService) ListApikeys(ctx context.Context, merchantCode string, params ListApikeysParams) (*ApikeysList, error)

ListApikeys: List API keys Returns paginated list of API keys.

func (*ApiKeysService) RevokeApikey

func (s *ApiKeysService) RevokeApikey(ctx context.Context, merchantCode string, keyId string) error

RevokeApikey: Revoke an API key Revokes an API key.

func (*ApiKeysService) UpdateApikey

func (s *ApiKeysService) UpdateApikey(ctx context.Context, merchantCode string, keyId string, body UpdateApikeyBody) error

UpdateApikey: Update an API key Updates an API key.

type Apikey

type Apikey struct {
	CreatedAt time.Time `json:"created_at"`
	// Unique identifier of the API Key.
	Id string `json:"id"`
	// User-assigned name of the API Key.
	Name string `json:"name"`
	// The plaintext value of the API key. This field is returned only in the response to API key creation and is
	// never again available in the plaintext form.
	Plaintext *string `json:"plaintext,omitempty"`
	// Last 8 characters of the API key.
	Preview string `json:"preview"`
	// Max items: 128
	Scopes    Oauth2Scopes `json:"scopes"`
	Type      ApikeyType   `json:"type"`
	UpdatedAt time.Time    `json:"updated_at"`
}

Apikey is a schema definition.

type ApikeyType

type ApikeyType string

ApikeyType is a schema definition.

const (
	ApikeyTypePublic ApikeyType = "public"
	ApikeyTypeSecret ApikeyType = "secret"
)

type ApikeysList

type ApikeysList struct {
	Items      []Apikey `json:"items"`
	TotalCount int      `json:"total_count"`
}

ApikeysList is a schema definition.

type CreateApikeyBody

type CreateApikeyBody struct {
	// Max length: 255
	Name string `json:"name"`
	// Max items: 128
	Scopes Oauth2Scopes `json:"scopes"`
}

CreateApikeyBody is a schema definition.

type ListApikeysParams

type ListApikeysParams struct {
	// Maximum number of keys to return.
	Limit *int
	// Offset of the first key to return.
	Offset *int
}

ListApikeysParams: query parameters for ListAPIKeys

func (*ListApikeysParams) QueryValues

func (p *ListApikeysParams) QueryValues() url.Values

QueryValues converts ListApikeysParams into url.Values.

type Oauth2Scope

type Oauth2Scope string

Oauth2Scope is a schema definition.

const (
	Oauth2ScopeAccountingRead      Oauth2Scope = "accounting.read"
	Oauth2ScopeAccountingWrite     Oauth2Scope = "accounting.write"
	Oauth2ScopeEmail               Oauth2Scope = "email"
	Oauth2ScopeInvoicesRead        Oauth2Scope = "invoices.read"
	Oauth2ScopeInvoicesWrite       Oauth2Scope = "invoices.write"
	Oauth2ScopePaymentInstruments  Oauth2Scope = "payment_instruments"
	Oauth2ScopePayments            Oauth2Scope = "payments"
	Oauth2ScopeProducts            Oauth2Scope = "products"
	Oauth2ScopeProfile             Oauth2Scope = "profile"
	Oauth2ScopeReadersRead         Oauth2Scope = "readers.read"
	Oauth2ScopeReadersWrite        Oauth2Scope = "readers.write"
	Oauth2ScopeTransactionsHistory Oauth2Scope = "transactions.history"
	Oauth2ScopeUserAppSettings     Oauth2Scope = "user.app-settings"
	Oauth2ScopeUserPayoutSettings  Oauth2Scope = "user.payout-settings"
	Oauth2ScopeUserProfile         Oauth2Scope = "user.profile"
	Oauth2ScopeUserProfileReadonly Oauth2Scope = "user.profile_readonly"
	Oauth2ScopeUserSubaccounts     Oauth2Scope = "user.subaccounts"
)

type Oauth2Scopes

type Oauth2Scopes []Oauth2Scope

Oauth2Scopes is a schema definition. Max items: 128

type UpdateApikeyBody

type UpdateApikeyBody struct {
	// New name for the API key.
	// Max length: 255
	Name string `json:"name"`
	// Max items: 128
	Scopes Oauth2Scopes `json:"scopes"`
}

UpdateApikeyBody is a schema definition.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL