Documentation
¶
Index ¶
- type ApiKeysService
- func (s *ApiKeysService) CreateApikey(ctx context.Context, merchantCode string, body CreateApikeyBody) (*Apikey, error)
- func (s *ApiKeysService) DeleteApikey(ctx context.Context, merchantCode string, keyId string) error
- func (s *ApiKeysService) GetApikey(ctx context.Context, merchantCode string, keyId string) (*Apikey, error)
- func (s *ApiKeysService) ListApikeys(ctx context.Context, merchantCode string, params ListApikeysParams) (*ApikeysList, error)
- func (s *ApiKeysService) UpdateApikey(ctx context.Context, merchantCode string, keyId string, body UpdateApikeyBody) error
- type Apikey
- type ApikeyType
- type ApikeysList
- type CreateApikeyBody
- type ListApikeysParams
- type Oauth2Scope
- type Oauth2Scopes
- type UpdateApikeyBody
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 Create a new API key.
func (*ApiKeysService) DeleteApikey ¶
DeleteApikey: Delete an API key Delete an API key.
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) 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 {
// The timestamp of when the API key was created.
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"`
// The timestamp of when the API key was last updated.
UpdatedAt time.Time `json:"updated_at"`
}
Apikey: An API key is a static token that allows you to authorize with SumUp APIs. Keep your API keys secret and safe. Do not share your API keys or expose them in a publicly accessible areas such as client-side code (browser or apps) or in the GitHub.
type ApikeyType ¶
type ApikeyType string
ApikeyType is a schema definition.
const ( ApikeyTypePublic ApikeyType = "public" ApikeyTypeSecret ApikeyType = "secret" )
type ApikeysList ¶
type ApikeysList struct {
// List of API keys.
Items []Apikey `json:"items"`
// Total number of API keys.
TotalCount int `json:"total_count"`
}
ApikeysList: List of API keys.
type CreateApikeyBody ¶
type CreateApikeyBody struct {
// Name of the API key.
// 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.