Documentation
¶
Index ¶
- Constants
- type APIKey
- type APIKeyList
- type APIKeyNewParams
- type APIKeyService
- func (r *APIKeyService) Delete(ctx context.Context, apiKeyID string, opts ...option.RequestOption) (err error)
- func (r *APIKeyService) Get(ctx context.Context, apiKeyID string, opts ...option.RequestOption) (res *APIKey, err error)
- func (r *APIKeyService) List(ctx context.Context, opts ...option.RequestOption) (res *APIKeyList, err error)
- func (r *APIKeyService) New(ctx context.Context, body APIKeyNewParams, opts ...option.RequestOption) (res *APIKey, err error)
- func (r *APIKeyService) Update(ctx context.Context, apiKeyID string, body APIKeyUpdateParams, ...) (res *APIKey, err error)
- type APIKeyStatus
- type APIKeyUpdateParams
- type Error
- type RegionName
- type ResourceStatus
Constants ¶
const RegionNameApSeo1 = shared.RegionNameApSeo1
This is an alias to an internal value.
const RegionNameApSin1 = shared.RegionNameApSin1
This is an alias to an internal value.
const RegionNameApTyo1 = shared.RegionNameApTyo1
This is an alias to an internal value.
const RegionNameEuAms1 = shared.RegionNameEuAms1
This is an alias to an internal value.
const RegionNameEuFrk1 = shared.RegionNameEuFrk1
This is an alias to an internal value.
const RegionNameEuLon1 = shared.RegionNameEuLon1
This is an alias to an internal value.
const RegionNameUsChi1 = shared.RegionNameUsChi1
This is an alias to an internal value.
const RegionNameUsSea1 = shared.RegionNameUsSea1
This is an alias to an internal value.
const RegionNameUsSva1 = shared.RegionNameUsSva1
This is an alias to an internal value.
const RegionNameUsWdc1 = shared.RegionNameUsWdc1
This is an alias to an internal value.
const ResourceStatusCreating = shared.ResourceStatusCreating
This is an alias to an internal value.
const ResourceStatusDeleted = shared.ResourceStatusDeleted
This is an alias to an internal value.
const ResourceStatusDeleting = shared.ResourceStatusDeleting
This is an alias to an internal value.
const ResourceStatusError = shared.ResourceStatusError
This is an alias to an internal value.
const ResourceStatusPending = shared.ResourceStatusPending
This is an alias to an internal value.
const ResourceStatusReady = shared.ResourceStatusReady
This is an alias to an internal value.
const ResourceStatusUpdating = shared.ResourceStatusUpdating
This is an alias to an internal value.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKey ¶
type APIKey struct {
// API key ID.
ID string `json:"id,required"`
// Time on which the API key was created.
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
// Time after which the API key is not valid.
ExpiresAt time.Time `json:"expires_at,required" format:"date-time"`
// API key name.
Name string `json:"name,required"`
// Status of the API key.
Status APIKeyStatus `json:"status,required"`
// Time on which the API key was updated.
UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
// User ID that owns the API key.
UserID string `json:"user_id,required"`
// API key.
Key string `json:"key"`
// Time before which the API key is not valid.
StartsAt time.Time `json:"starts_at" format:"date-time"`
JSON apiKeyJSON `json:"-"`
}
API key response.
func (*APIKey) UnmarshalJSON ¶
type APIKeyList ¶
type APIKeyList struct {
Items []APIKey `json:"items,required"`
JSON apiKeyListJSON `json:"-"`
}
func (*APIKeyList) UnmarshalJSON ¶
func (r *APIKeyList) UnmarshalJSON(data []byte) (err error)
type APIKeyNewParams ¶
type APIKeyNewParams struct {
// Time after which the API key is not valid.
ExpiresAt param.Field[time.Time] `json:"expires_at,required" format:"date-time"`
// API key name.
Name param.Field[string] `json:"name,required"`
// Time before which the API key is not valid.
StartsAt param.Field[time.Time] `json:"starts_at" format:"date-time"`
}
func (APIKeyNewParams) MarshalJSON ¶
func (r APIKeyNewParams) MarshalJSON() (data []byte, err error)
type APIKeyService ¶
type APIKeyService struct {
Options []option.RequestOption
}
APIKeyService contains methods and other services that help with interacting with the Nirvana Labs API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAPIKeyService method instead.
func NewAPIKeyService ¶
func NewAPIKeyService(opts ...option.RequestOption) (r *APIKeyService)
NewAPIKeyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*APIKeyService) Delete ¶
func (r *APIKeyService) Delete(ctx context.Context, apiKeyID string, opts ...option.RequestOption) (err error)
Delete an API key
func (*APIKeyService) Get ¶
func (r *APIKeyService) Get(ctx context.Context, apiKeyID string, opts ...option.RequestOption) (res *APIKey, err error)
Get details about an API key
func (*APIKeyService) List ¶
func (r *APIKeyService) List(ctx context.Context, opts ...option.RequestOption) (res *APIKeyList, err error)
List all API keys you created
func (*APIKeyService) New ¶
func (r *APIKeyService) New(ctx context.Context, body APIKeyNewParams, opts ...option.RequestOption) (res *APIKey, err error)
Create a new API key
func (*APIKeyService) Update ¶ added in v0.4.0
func (r *APIKeyService) Update(ctx context.Context, apiKeyID string, body APIKeyUpdateParams, opts ...option.RequestOption) (res *APIKey, err error)
Update an API key's name
type APIKeyStatus ¶
type APIKeyStatus string
Status of the API key.
const ( APIKeyStatusActive APIKeyStatus = "active" APIKeyStatusInactive APIKeyStatus = "inactive" APIKeyStatusExpired APIKeyStatus = "expired" )
func (APIKeyStatus) IsKnown ¶
func (r APIKeyStatus) IsKnown() bool
type APIKeyUpdateParams ¶ added in v0.4.0
func (APIKeyUpdateParams) MarshalJSON ¶ added in v0.4.0
func (r APIKeyUpdateParams) MarshalJSON() (data []byte, err error)
type ResourceStatus ¶
type ResourceStatus = shared.ResourceStatus
This is an alias to an internal type.