iam

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIToken

type APIToken struct {
	// API token ID.
	ID         int64              `json:"id,required"`
	ClientUser APITokenClientUser `json:"client_user,required"`
	// Date when the API token was issued (ISO 8086/RFC 3339 format), UTC.
	Created string `json:"created,required"`
	// Deletion flag. If true, then the API token was deleted.
	Deleted bool `json:"deleted,required"`
	// Date when the API token becomes expired (ISO 8086/RFC 3339 format), UTC. If
	// null, then the API token will never expire.
	ExpDate string `json:"exp_date,required"`
	// Expiration flag. If true, then the API token has expired. When an API token
	// expires it will be automatically deleted.
	Expired bool `json:"expired,required"`
	// Date when the API token was last used (ISO 8086/RFC 3339 format), UTC.
	LastUsage string `json:"last_usage,required"`
	// API token name.
	Name string `json:"name,required"`
	// API token description.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ClientUser  respjson.Field
		Created     respjson.Field
		Deleted     respjson.Field
		ExpDate     respjson.Field
		Expired     respjson.Field
		LastUsage   respjson.Field
		Name        respjson.Field
		Description respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (APIToken) RawJSON

func (r APIToken) RawJSON() string

Returns the unmodified JSON received from the API

func (*APIToken) UnmarshalJSON

func (r *APIToken) UnmarshalJSON(data []byte) error

type APITokenClientUser

type APITokenClientUser struct {
	// Account's ID.
	ClientID int64 `json:"client_id,required"`
	// Deletion flag. If true, then the API token was deleted.
	Deleted bool                   `json:"deleted,required"`
	Role    APITokenClientUserRole `json:"role,required"`
	// User's email who issued the API token.
	UserEmail string `json:"user_email,required"`
	// User's ID who issued the API token.
	UserID int64 `json:"user_id,required"`
	// User's name who issued the API token.
	UserName string `json:"user_name,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ClientID    respjson.Field
		Deleted     respjson.Field
		Role        respjson.Field
		UserEmail   respjson.Field
		UserID      respjson.Field
		UserName    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (APITokenClientUser) RawJSON

func (r APITokenClientUser) RawJSON() string

Returns the unmodified JSON received from the API

func (*APITokenClientUser) UnmarshalJSON

func (r *APITokenClientUser) UnmarshalJSON(data []byte) error

type APITokenClientUserRole

type APITokenClientUserRole struct {
	// Group's ID: Possible values are:
	//
	//   - 1 - Administrators* 2 - Users* 5 - Engineers* 3009 - Purge and Prefetch only
	//     (API+Web)* 3022 - Purge and Prefetch only (API)
	ID int64 `json:"id"`
	// Group's name.
	//
	// Any of "Users", "Administrators", "Engineers", "Purge and Prefetch only (API)",
	// "Purge and Prefetch only (API+Web)".
	Name string `json:"name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (APITokenClientUserRole) RawJSON

func (r APITokenClientUserRole) RawJSON() string

Returns the unmodified JSON received from the API

func (*APITokenClientUserRole) UnmarshalJSON

func (r *APITokenClientUserRole) UnmarshalJSON(data []byte) error

type APITokenCreate

type APITokenCreate struct {
	// API token. Copy it, because you will not be able to get it again. We do not
	// store tokens. All responsibility for token storage and usage is on the issuer.
	Token string `json:"token"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Token       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (APITokenCreate) RawJSON

func (r APITokenCreate) RawJSON() string

Returns the unmodified JSON received from the API

func (*APITokenCreate) UnmarshalJSON

func (r *APITokenCreate) UnmarshalJSON(data []byte) error

type APITokenDeleteParams

type APITokenDeleteParams struct {
	ClientID int64 `path:"clientId,required" json:"-"`
	// contains filtered or unexported fields
}

type APITokenGetParams

type APITokenGetParams struct {
	ClientID int64 `path:"clientId,required" json:"-"`
	// contains filtered or unexported fields
}

type APITokenList

type APITokenList []APITokenListItem

type APITokenListItem

type APITokenListItem struct {
	// API token ID.
	ID         int64                      `json:"id,required"`
	ClientUser APITokenListItemClientUser `json:"client_user,required"`
	// Date when the API token was issued (ISO 8086/RFC 3339 format), UTC.
	Created string `json:"created,required"`
	// Deletion flag. If true, then the API token was deleted.
	Deleted bool `json:"deleted,required"`
	// Date when the API token becomes expired (ISO 8086/RFC 3339 format), UTC. If
	// null, then the API token will never expire.
	ExpDate string `json:"exp_date,required"`
	// Expiration flag. If true, then the API token has expired. When an API token
	// expires it will be automatically deleted.
	Expired bool `json:"expired,required"`
	// Date when the API token was last used (ISO 8086/RFC 3339 format), UTC.
	LastUsage string `json:"last_usage,required"`
	// API token name.
	Name string `json:"name,required"`
	// API token description.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ClientUser  respjson.Field
		Created     respjson.Field
		Deleted     respjson.Field
		ExpDate     respjson.Field
		Expired     respjson.Field
		LastUsage   respjson.Field
		Name        respjson.Field
		Description respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (APITokenListItem) RawJSON

func (r APITokenListItem) RawJSON() string

Returns the unmodified JSON received from the API

func (*APITokenListItem) UnmarshalJSON

func (r *APITokenListItem) UnmarshalJSON(data []byte) error

type APITokenListItemClientUser

type APITokenListItemClientUser struct {
	// Account's ID.
	ClientID int64 `json:"client_id,required"`
	// Deletion flag. If true, then the API token was deleted.
	Deleted bool                           `json:"deleted,required"`
	Role    APITokenListItemClientUserRole `json:"role,required"`
	// User's email who issued the API token.
	UserEmail string `json:"user_email,required"`
	// User's ID who issued the API token.
	UserID int64 `json:"user_id,required"`
	// User's name who issued the API token.
	UserName string `json:"user_name,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ClientID    respjson.Field
		Deleted     respjson.Field
		Role        respjson.Field
		UserEmail   respjson.Field
		UserID      respjson.Field
		UserName    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (APITokenListItemClientUser) RawJSON

func (r APITokenListItemClientUser) RawJSON() string

Returns the unmodified JSON received from the API

func (*APITokenListItemClientUser) UnmarshalJSON

func (r *APITokenListItemClientUser) UnmarshalJSON(data []byte) error

type APITokenListItemClientUserRole

type APITokenListItemClientUserRole struct {
	// Group's ID: Possible values are:
	//
	//   - 1 - Administrators* 2 - Users* 5 - Engineers* 3009 - Purge and Prefetch only
	//     (API+Web)* 3022 - Purge and Prefetch only (API)
	ID int64 `json:"id"`
	// Group's name.
	//
	// Any of "Users", "Administrators", "Engineers", "Purge and Prefetch only (API)",
	// "Purge and Prefetch only (API+Web)".
	Name string `json:"name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (APITokenListItemClientUserRole) RawJSON

Returns the unmodified JSON received from the API

func (*APITokenListItemClientUserRole) UnmarshalJSON

func (r *APITokenListItemClientUserRole) UnmarshalJSON(data []byte) error

type APITokenListParams

type APITokenListParams struct {
	// The state of API tokens included in the response.
	//
	//	Two possible values:
	//
	// - True - API token was not deleted.\* False - API token was deleted.
	//
	// Example, _&deleted=True_
	Deleted param.Opt[bool] `query:"deleted,omitzero" json:"-"`
	// User's ID. Use to get API tokens issued by a particular user.
	//
	//	Example, _&`issued_by`=1234_
	IssuedBy param.Opt[int64] `query:"issued_by,omitzero" json:"-"`
	// User's ID. Use to get API tokens issued by anyone except a particular user.
	//
	//	Example, _¬_issued_by=1234_
	NotIssuedBy param.Opt[int64] `query:"not_issued_by,omitzero" json:"-"`
	// Group's ID. Possible values are:
	//
	//   - 1 - Administrators* 2 - Users* 5 - Engineers* 3009 - Purge and Prefetch only
	//     (API+Web)* 3022 - Purge and Prefetch only (API)
	//
	// Example, _&role=Engineers_
	Role param.Opt[string] `query:"role,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (APITokenListParams) URLQuery

func (r APITokenListParams) URLQuery() (v url.Values, err error)

URLQuery serializes APITokenListParams's query parameters as `url.Values`.

type APITokenNewParams

type APITokenNewParams struct {
	// Date when the API token becomes expired (ISO 8086/RFC 3339 format), UTC. If
	// null, then the API token will never expire.
	ExpDate param.Opt[string] `json:"exp_date,omitzero,required"`
	// API token role.
	ClientUser APITokenNewParamsClientUser `json:"client_user,omitzero,required"`
	// API token name.
	Name string `json:"name,required"`
	// API token description.
	Description param.Opt[string] `json:"description,omitzero"`
	// contains filtered or unexported fields
}

func (APITokenNewParams) MarshalJSON

func (r APITokenNewParams) MarshalJSON() (data []byte, err error)

func (*APITokenNewParams) UnmarshalJSON

func (r *APITokenNewParams) UnmarshalJSON(data []byte) error

type APITokenNewParamsClientUser

type APITokenNewParamsClientUser struct {
	Role APITokenNewParamsClientUserRole `json:"role,omitzero"`
	// contains filtered or unexported fields
}

API token role.

func (APITokenNewParamsClientUser) MarshalJSON

func (r APITokenNewParamsClientUser) MarshalJSON() (data []byte, err error)

func (*APITokenNewParamsClientUser) UnmarshalJSON

func (r *APITokenNewParamsClientUser) UnmarshalJSON(data []byte) error

type APITokenNewParamsClientUserRole

type APITokenNewParamsClientUserRole struct {
	// Group's ID: Possible values are:
	//
	//   - 1 - Administrators* 2 - Users* 5 - Engineers* 3009 - Purge and Prefetch only
	//     (API+Web)* 3022 - Purge and Prefetch only (API)
	ID param.Opt[int64] `json:"id,omitzero"`
	// Group's name.
	//
	// Any of "Users", "Administrators", "Engineers", "Purge and Prefetch only (API)",
	// "Purge and Prefetch only (API+Web)".
	Name string `json:"name,omitzero"`
	// contains filtered or unexported fields
}

func (APITokenNewParamsClientUserRole) MarshalJSON

func (r APITokenNewParamsClientUserRole) MarshalJSON() (data []byte, err error)

func (*APITokenNewParamsClientUserRole) UnmarshalJSON

func (r *APITokenNewParamsClientUserRole) UnmarshalJSON(data []byte) error

type APITokenService

type APITokenService struct {
	Options []option.RequestOption
}

APITokenService contains methods and other services that help with interacting with the gcore 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 NewAPITokenService method instead.

func NewAPITokenService

func NewAPITokenService(opts ...option.RequestOption) (r APITokenService)

NewAPITokenService 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 (*APITokenService) Delete

func (r *APITokenService) Delete(ctx context.Context, tokenID int64, body APITokenDeleteParams, opts ...option.RequestOption) (err error)

Delete API token from current account. Ensure that the API token is not being used by an active application. After deleting the token, all applications that use this token will not be able to get access to your account via API. The action cannot be reversed.

func (*APITokenService) Get

func (r *APITokenService) Get(ctx context.Context, tokenID int64, query APITokenGetParams, opts ...option.RequestOption) (res *APIToken, err error)

Get API Token

func (*APITokenService) List

func (r *APITokenService) List(ctx context.Context, clientID int64, query APITokenListParams, opts ...option.RequestOption) (res *APITokenList, err error)

Get information about your permanent API tokens in the account. A user with the Administrators role gets information about all API tokens in the account.

func (*APITokenService) New

func (r *APITokenService) New(ctx context.Context, clientID int64, body APITokenNewParams, opts ...option.RequestOption) (res *APITokenCreate, err error)

Create an API token in the current account.

type AccountOverview

type AccountOverview struct {
	// The account ID.
	ID int64 `json:"id,required"`
	// System field. Billing type of the account.
	BillType string `json:"bill_type,required"`
	// System field. List of services available for the account.
	//
	// Any of "CDN", "STORAGE", "STREAMING", "DNS", "DDOS", "CLOUD".
	Capabilities []string `json:"capabilities,required"`
	// The company name.
	CompanyName string `json:"companyName,required"`
	// ID of the current user.
	CurrentUser int64 `json:"currentUser,required"`
	// The field shows the status of the account:
	//
	// - `true` – the account has been deleted
	// - `false` – the account is not deleted
	Deleted bool `json:"deleted,required"`
	// The account email.
	Email string `json:"email,required" format:"email"`
	// System field. Control panel domain.
	EntryBaseDomain string `json:"entryBaseDomain,required"`
	// An object of arrays which contains information about free features available for
	// the requested account.
	FreeFeatures AccountOverviewFreeFeatures `json:"freeFeatures,required"`
	// System field.
	HasActiveAdmin bool `json:"has_active_admin,required"`
	// System field:
	//
	// - `true` — a test account;
	// - `false` — a production account.
	IsTest bool `json:"is_test,required"`
	// Name of a user who registered the requested account.
	Name string `json:"name,required"`
	// An object of arrays which contains information about paid features available for
	// the requested account.
	PaidFeatures AccountOverviewPaidFeatures `json:"paidFeatures,required"`
	// An object of arrays which contains information about all services available for
	// the requested account.
	ServiceStatuses AccountOverviewServiceStatuses `json:"serviceStatuses,required"`
	// Status of the account.
	//
	// Any of "new", "trial", "trialend", "active", "integration", "paused",
	// "preparation", "ready".
	Status AccountOverviewStatus `json:"status,required"`
	// System field. The company country (ISO 3166-1 alpha-2 format).
	CountryCode string `json:"country_code"`
	// The account custom ID.
	CustomID string `json:"custom_id,nullable"`
	// Phone of a user who registered the requested account.
	Phone string `json:"phone,nullable"`
	// System field. Type of the account registration process.
	//
	// Any of "sign_up_full", "sign_up_simple".
	SignupProcess AccountOverviewSignupProcess `json:"signup_process,nullable"`
	// List of account users.
	Users []AccountOverviewUser `json:"users"`
	// The company website.
	Website string `json:"website"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		BillType        respjson.Field
		Capabilities    respjson.Field
		CompanyName     respjson.Field
		CurrentUser     respjson.Field
		Deleted         respjson.Field
		Email           respjson.Field
		EntryBaseDomain respjson.Field
		FreeFeatures    respjson.Field
		HasActiveAdmin  respjson.Field
		IsTest          respjson.Field
		Name            respjson.Field
		PaidFeatures    respjson.Field
		ServiceStatuses respjson.Field
		Status          respjson.Field
		CountryCode     respjson.Field
		CustomID        respjson.Field
		Phone           respjson.Field
		SignupProcess   respjson.Field
		Users           respjson.Field
		Website         respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountOverview) RawJSON

func (r AccountOverview) RawJSON() string

Returns the unmodified JSON received from the API

func (*AccountOverview) UnmarshalJSON

func (r *AccountOverview) UnmarshalJSON(data []byte) error

type AccountOverviewFreeFeatures

type AccountOverviewFreeFeatures struct {
	Cdn       []AccountOverviewFreeFeaturesCdn       `json:"CDN"`
	Cloud     []AccountOverviewFreeFeaturesCloud     `json:"CLOUD"`
	DDOS      []AccountOverviewFreeFeaturesDDOS      `json:"DDOS"`
	DNS       []AccountOverviewFreeFeaturesDNS       `json:"DNS"`
	Storage   []AccountOverviewFreeFeaturesStorage   `json:"STORAGE"`
	Streaming []AccountOverviewFreeFeaturesStreaming `json:"STREAMING"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Cdn         respjson.Field
		Cloud       respjson.Field
		DDOS        respjson.Field
		DNS         respjson.Field
		Storage     respjson.Field
		Streaming   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An object of arrays which contains information about free features available for the requested account.

func (AccountOverviewFreeFeatures) RawJSON

func (r AccountOverviewFreeFeatures) RawJSON() string

Returns the unmodified JSON received from the API

func (*AccountOverviewFreeFeatures) UnmarshalJSON

func (r *AccountOverviewFreeFeatures) UnmarshalJSON(data []byte) error

type AccountOverviewFreeFeaturesCdn

type AccountOverviewFreeFeaturesCdn struct {
	// Date and time when the feature was activated (ISO 8086/RFC 3339 format).
	CreateDate string `json:"create_date"`
	// Feature ID.
	FeatureID int64 `json:"feature_id"`
	// Internal feature activation ID.
	FreeFeatureID int64 `json:"free_feature_id"`
	// Name of the feature.
	Name string `json:"name"`
	// Service's name.
	//
	// Any of "CDN", "STORAGE", "STREAMING", "DNS", "DDOS", "CLOUD".
	Service string `json:"service"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreateDate    respjson.Field
		FeatureID     respjson.Field
		FreeFeatureID respjson.Field
		Name          respjson.Field
		Service       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Feature object.

func (AccountOverviewFreeFeaturesCdn) RawJSON

Returns the unmodified JSON received from the API

func (*AccountOverviewFreeFeaturesCdn) UnmarshalJSON

func (r *AccountOverviewFreeFeaturesCdn) UnmarshalJSON(data []byte) error

type AccountOverviewFreeFeaturesCloud

type AccountOverviewFreeFeaturesCloud struct {
	// Date and time when the feature was activated (ISO 8086/RFC 3339 format).
	CreateDate string `json:"create_date"`
	// Feature ID.
	FeatureID int64 `json:"feature_id"`
	// Internal feature activation ID.
	FreeFeatureID int64 `json:"free_feature_id"`
	// Name of the feature.
	Name string `json:"name"`
	// Service's name.
	//
	// Any of "CDN", "STORAGE", "STREAMING", "DNS", "DDOS", "CLOUD".
	Service string `json:"service"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreateDate    respjson.Field
		FeatureID     respjson.Field
		FreeFeatureID respjson.Field
		Name          respjson.Field
		Service       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Feature object.

func (AccountOverviewFreeFeaturesCloud) RawJSON

Returns the unmodified JSON received from the API

func (*AccountOverviewFreeFeaturesCloud) UnmarshalJSON

func (r *AccountOverviewFreeFeaturesCloud) UnmarshalJSON(data []byte) error

type AccountOverviewFreeFeaturesDDOS

type AccountOverviewFreeFeaturesDDOS struct {
	// Date and time when the feature was activated (ISO 8086/RFC 3339 format).
	CreateDate string `json:"create_date"`
	// Feature ID.
	FeatureID int64 `json:"feature_id"`
	// Internal feature activation ID.
	FreeFeatureID int64 `json:"free_feature_id"`
	// Name of the feature.
	Name string `json:"name"`
	// Service's name.
	//
	// Any of "CDN", "STORAGE", "STREAMING", "DNS", "DDOS", "CLOUD".
	Service string `json:"service"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreateDate    respjson.Field
		FeatureID     respjson.Field
		FreeFeatureID respjson.Field
		Name          respjson.Field
		Service       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Feature object.

func (AccountOverviewFreeFeaturesDDOS) RawJSON

Returns the unmodified JSON received from the API

func (*AccountOverviewFreeFeaturesDDOS) UnmarshalJSON

func (r *AccountOverviewFreeFeaturesDDOS) UnmarshalJSON(data []byte) error

type AccountOverviewFreeFeaturesDNS

type AccountOverviewFreeFeaturesDNS struct {
	// Date and time when the feature was activated (ISO 8086/RFC 3339 format).
	CreateDate string `json:"create_date"`
	// Feature ID.
	FeatureID int64 `json:"feature_id"`
	// Internal feature activation ID.
	FreeFeatureID int64 `json:"free_feature_id"`
	// Name of the feature.
	Name string `json:"name"`
	// Service's name.
	//
	// Any of "CDN", "STORAGE", "STREAMING", "DNS", "DDOS", "CLOUD".
	Service string `json:"service"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreateDate    respjson.Field
		FeatureID     respjson.Field
		FreeFeatureID respjson.Field
		Name          respjson.Field
		Service       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Feature object.

func (AccountOverviewFreeFeaturesDNS) RawJSON

Returns the unmodified JSON received from the API

func (*AccountOverviewFreeFeaturesDNS) UnmarshalJSON

func (r *AccountOverviewFreeFeaturesDNS) UnmarshalJSON(data []byte) error

type AccountOverviewFreeFeaturesStorage

type AccountOverviewFreeFeaturesStorage struct {
	// Date and time when the feature was activated (ISO 8086/RFC 3339 format).
	CreateDate string `json:"create_date"`
	// Feature ID.
	FeatureID int64 `json:"feature_id"`
	// Internal feature activation ID.
	FreeFeatureID int64 `json:"free_feature_id"`
	// Name of the feature.
	Name string `json:"name"`
	// Service's name.
	//
	// Any of "CDN", "STORAGE", "STREAMING", "DNS", "DDOS", "CLOUD".
	Service string `json:"service"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreateDate    respjson.Field
		FeatureID     respjson.Field
		FreeFeatureID respjson.Field
		Name          respjson.Field
		Service       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Feature object.

func (AccountOverviewFreeFeaturesStorage) RawJSON

Returns the unmodified JSON received from the API

func (*AccountOverviewFreeFeaturesStorage) UnmarshalJSON

func (r *AccountOverviewFreeFeaturesStorage) UnmarshalJSON(data []byte) error

type AccountOverviewFreeFeaturesStreaming

type AccountOverviewFreeFeaturesStreaming struct {
	// Date and time when the feature was activated (ISO 8086/RFC 3339 format).
	CreateDate string `json:"create_date"`
	// Feature ID.
	FeatureID int64 `json:"feature_id"`
	// Internal feature activation ID.
	FreeFeatureID int64 `json:"free_feature_id"`
	// Name of the feature.
	Name string `json:"name"`
	// Service's name.
	//
	// Any of "CDN", "STORAGE", "STREAMING", "DNS", "DDOS", "CLOUD".
	Service string `json:"service"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreateDate    respjson.Field
		FeatureID     respjson.Field
		FreeFeatureID respjson.Field
		Name          respjson.Field
		Service       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Feature object.

func (AccountOverviewFreeFeaturesStreaming) RawJSON

Returns the unmodified JSON received from the API

func (*AccountOverviewFreeFeaturesStreaming) UnmarshalJSON

func (r *AccountOverviewFreeFeaturesStreaming) UnmarshalJSON(data []byte) error

type AccountOverviewPaidFeatures

type AccountOverviewPaidFeatures struct {
	Cdn       []AccountOverviewPaidFeaturesCdn       `json:"CDN"`
	Cloud     []AccountOverviewPaidFeaturesCloud     `json:"CLOUD"`
	DDOS      []AccountOverviewPaidFeaturesDDOS      `json:"DDOS"`
	DNS       []AccountOverviewPaidFeaturesDNS       `json:"DNS"`
	Storage   []AccountOverviewPaidFeaturesStorage   `json:"STORAGE"`
	Streaming []AccountOverviewPaidFeaturesStreaming `json:"STREAMING"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Cdn         respjson.Field
		Cloud       respjson.Field
		DDOS        respjson.Field
		DNS         respjson.Field
		Storage     respjson.Field
		Streaming   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An object of arrays which contains information about paid features available for the requested account.

func (AccountOverviewPaidFeatures) RawJSON

func (r AccountOverviewPaidFeatures) RawJSON() string

Returns the unmodified JSON received from the API

func (*AccountOverviewPaidFeatures) UnmarshalJSON

func (r *AccountOverviewPaidFeatures) UnmarshalJSON(data []byte) error

type AccountOverviewPaidFeaturesCdn

type AccountOverviewPaidFeaturesCdn struct {
	// Date and time when the feature was activated (ISO 8086/RFC 3339 format).
	CreateDate string `json:"create_date"`
	// Feature ID.
	FeatureID int64 `json:"feature_id"`
	// Name of the feature.
	Name string `json:"name"`
	// Internal feature activation ID.
	PaidFeatureID int64 `json:"paid_feature_id"`
	// Service's name.
	//
	// Any of "CDN", "STORAGE", "STREAMING", "DNS", "DDOS", "CLOUD".
	Service string `json:"service"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreateDate    respjson.Field
		FeatureID     respjson.Field
		Name          respjson.Field
		PaidFeatureID respjson.Field
		Service       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Feature object.

func (AccountOverviewPaidFeaturesCdn) RawJSON

Returns the unmodified JSON received from the API

func (*AccountOverviewPaidFeaturesCdn) UnmarshalJSON

func (r *AccountOverviewPaidFeaturesCdn) UnmarshalJSON(data []byte) error

type AccountOverviewPaidFeaturesCloud

type AccountOverviewPaidFeaturesCloud struct {
	// Date and time when the feature was activated (ISO 8086/RFC 3339 format).
	CreateDate string `json:"create_date"`
	// Feature ID.
	FeatureID int64 `json:"feature_id"`
	// Name of the feature.
	Name string `json:"name"`
	// Internal feature activation ID.
	PaidFeatureID int64 `json:"paid_feature_id"`
	// Service's name.
	//
	// Any of "CDN", "STORAGE", "STREAMING", "DNS", "DDOS", "CLOUD".
	Service string `json:"service"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreateDate    respjson.Field
		FeatureID     respjson.Field
		Name          respjson.Field
		PaidFeatureID respjson.Field
		Service       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Feature object.

func (AccountOverviewPaidFeaturesCloud) RawJSON

Returns the unmodified JSON received from the API

func (*AccountOverviewPaidFeaturesCloud) UnmarshalJSON

func (r *AccountOverviewPaidFeaturesCloud) UnmarshalJSON(data []byte) error

type AccountOverviewPaidFeaturesDDOS

type AccountOverviewPaidFeaturesDDOS struct {
	// Date and time when the feature was activated (ISO 8086/RFC 3339 format).
	CreateDate string `json:"create_date"`
	// Feature ID.
	FeatureID int64 `json:"feature_id"`
	// Name of the feature.
	Name string `json:"name"`
	// Internal feature activation ID.
	PaidFeatureID int64 `json:"paid_feature_id"`
	// Service's name.
	//
	// Any of "CDN", "STORAGE", "STREAMING", "DNS", "DDOS", "CLOUD".
	Service string `json:"service"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreateDate    respjson.Field
		FeatureID     respjson.Field
		Name          respjson.Field
		PaidFeatureID respjson.Field
		Service       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Feature object.

func (AccountOverviewPaidFeaturesDDOS) RawJSON

Returns the unmodified JSON received from the API

func (*AccountOverviewPaidFeaturesDDOS) UnmarshalJSON

func (r *AccountOverviewPaidFeaturesDDOS) UnmarshalJSON(data []byte) error

type AccountOverviewPaidFeaturesDNS

type AccountOverviewPaidFeaturesDNS struct {
	// Date and time when the feature was activated (ISO 8086/RFC 3339 format).
	CreateDate string `json:"create_date"`
	// Feature ID.
	FeatureID int64 `json:"feature_id"`
	// Name of the feature.
	Name string `json:"name"`
	// Internal feature activation ID.
	PaidFeatureID int64 `json:"paid_feature_id"`
	// Service's name.
	//
	// Any of "CDN", "STORAGE", "STREAMING", "DNS", "DDOS", "CLOUD".
	Service string `json:"service"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreateDate    respjson.Field
		FeatureID     respjson.Field
		Name          respjson.Field
		PaidFeatureID respjson.Field
		Service       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Feature object.

func (AccountOverviewPaidFeaturesDNS) RawJSON

Returns the unmodified JSON received from the API

func (*AccountOverviewPaidFeaturesDNS) UnmarshalJSON

func (r *AccountOverviewPaidFeaturesDNS) UnmarshalJSON(data []byte) error

type AccountOverviewPaidFeaturesStorage

type AccountOverviewPaidFeaturesStorage struct {
	// Date and time when the feature was activated (ISO 8086/RFC 3339 format).
	CreateDate string `json:"create_date"`
	// Feature ID.
	FeatureID int64 `json:"feature_id"`
	// Name of the feature.
	Name string `json:"name"`
	// Internal feature activation ID.
	PaidFeatureID int64 `json:"paid_feature_id"`
	// Service's name.
	//
	// Any of "CDN", "STORAGE", "STREAMING", "DNS", "DDOS", "CLOUD".
	Service string `json:"service"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreateDate    respjson.Field
		FeatureID     respjson.Field
		Name          respjson.Field
		PaidFeatureID respjson.Field
		Service       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Feature object.

func (AccountOverviewPaidFeaturesStorage) RawJSON

Returns the unmodified JSON received from the API

func (*AccountOverviewPaidFeaturesStorage) UnmarshalJSON

func (r *AccountOverviewPaidFeaturesStorage) UnmarshalJSON(data []byte) error

type AccountOverviewPaidFeaturesStreaming

type AccountOverviewPaidFeaturesStreaming struct {
	// Date and time when the feature was activated (ISO 8086/RFC 3339 format).
	CreateDate string `json:"create_date"`
	// Feature ID.
	FeatureID int64 `json:"feature_id"`
	// Name of the feature.
	Name string `json:"name"`
	// Internal feature activation ID.
	PaidFeatureID int64 `json:"paid_feature_id"`
	// Service's name.
	//
	// Any of "CDN", "STORAGE", "STREAMING", "DNS", "DDOS", "CLOUD".
	Service string `json:"service"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreateDate    respjson.Field
		FeatureID     respjson.Field
		Name          respjson.Field
		PaidFeatureID respjson.Field
		Service       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Feature object.

func (AccountOverviewPaidFeaturesStreaming) RawJSON

Returns the unmodified JSON received from the API

func (*AccountOverviewPaidFeaturesStreaming) UnmarshalJSON

func (r *AccountOverviewPaidFeaturesStreaming) UnmarshalJSON(data []byte) error

type AccountOverviewServiceStatuses

type AccountOverviewServiceStatuses struct {
	Cdn       AccountOverviewServiceStatusesCdn       `json:"CDN"`
	Cloud     AccountOverviewServiceStatusesCloud     `json:"CLOUD"`
	DDOS      AccountOverviewServiceStatusesDDOS      `json:"DDOS"`
	DNS       AccountOverviewServiceStatusesDNS       `json:"DNS"`
	Storage   AccountOverviewServiceStatusesStorage   `json:"STORAGE"`
	Streaming AccountOverviewServiceStatusesStreaming `json:"STREAMING"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Cdn         respjson.Field
		Cloud       respjson.Field
		DDOS        respjson.Field
		DNS         respjson.Field
		Storage     respjson.Field
		Streaming   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An object of arrays which contains information about all services available for the requested account.

func (AccountOverviewServiceStatuses) RawJSON

Returns the unmodified JSON received from the API

func (*AccountOverviewServiceStatuses) UnmarshalJSON

func (r *AccountOverviewServiceStatuses) UnmarshalJSON(data []byte) error

type AccountOverviewServiceStatusesCdn

type AccountOverviewServiceStatusesCdn struct {
	// `true` - service is available in the Control Panel.
	Enabled bool `json:"enabled"`
	// Status of the service.
	//
	// Any of "new", "trial", "trialend", "active", "paused", "activating", "deleted".
	Status string `json:"status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountOverviewServiceStatusesCdn) RawJSON

Returns the unmodified JSON received from the API

func (*AccountOverviewServiceStatusesCdn) UnmarshalJSON

func (r *AccountOverviewServiceStatusesCdn) UnmarshalJSON(data []byte) error

type AccountOverviewServiceStatusesCloud

type AccountOverviewServiceStatusesCloud struct {
	// `true` - service is available in the Control Panel.
	Enabled bool `json:"enabled"`
	// Status of the service.
	//
	// Any of "new", "trial", "trialend", "active", "paused", "activating", "deleted".
	Status string `json:"status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountOverviewServiceStatusesCloud) RawJSON

Returns the unmodified JSON received from the API

func (*AccountOverviewServiceStatusesCloud) UnmarshalJSON

func (r *AccountOverviewServiceStatusesCloud) UnmarshalJSON(data []byte) error

type AccountOverviewServiceStatusesDDOS

type AccountOverviewServiceStatusesDDOS struct {
	// `true` - service is available in the Control Panel.
	Enabled bool `json:"enabled"`
	// Status of the service.
	//
	// Any of "new", "trial", "trialend", "active", "paused", "activating", "deleted".
	Status string `json:"status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountOverviewServiceStatusesDDOS) RawJSON

Returns the unmodified JSON received from the API

func (*AccountOverviewServiceStatusesDDOS) UnmarshalJSON

func (r *AccountOverviewServiceStatusesDDOS) UnmarshalJSON(data []byte) error

type AccountOverviewServiceStatusesDNS

type AccountOverviewServiceStatusesDNS struct {
	// `true` - service is available in the Control Panel.
	Enabled bool `json:"enabled"`
	// Status of the service.
	//
	// Any of "new", "trial", "trialend", "active", "paused", "activating", "deleted".
	Status string `json:"status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountOverviewServiceStatusesDNS) RawJSON

Returns the unmodified JSON received from the API

func (*AccountOverviewServiceStatusesDNS) UnmarshalJSON

func (r *AccountOverviewServiceStatusesDNS) UnmarshalJSON(data []byte) error

type AccountOverviewServiceStatusesStorage

type AccountOverviewServiceStatusesStorage struct {
	// `true` - service is available in the Control Panel.
	Enabled bool `json:"enabled"`
	// Status of the service.
	//
	// Any of "new", "trial", "trialend", "active", "paused", "activating", "deleted".
	Status string `json:"status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountOverviewServiceStatusesStorage) RawJSON

Returns the unmodified JSON received from the API

func (*AccountOverviewServiceStatusesStorage) UnmarshalJSON

func (r *AccountOverviewServiceStatusesStorage) UnmarshalJSON(data []byte) error

type AccountOverviewServiceStatusesStreaming

type AccountOverviewServiceStatusesStreaming struct {
	// `true` - service is available in the Control Panel.
	Enabled bool `json:"enabled"`
	// Status of the service.
	//
	// Any of "new", "trial", "trialend", "active", "paused", "activating", "deleted".
	Status string `json:"status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountOverviewServiceStatusesStreaming) RawJSON

Returns the unmodified JSON received from the API

func (*AccountOverviewServiceStatusesStreaming) UnmarshalJSON

func (r *AccountOverviewServiceStatusesStreaming) UnmarshalJSON(data []byte) error

type AccountOverviewSignupProcess

type AccountOverviewSignupProcess string

System field. Type of the account registration process.

const (
	AccountOverviewSignupProcessSignUpFull   AccountOverviewSignupProcess = "sign_up_full"
	AccountOverviewSignupProcessSignUpSimple AccountOverviewSignupProcess = "sign_up_simple"
)

type AccountOverviewStatus

type AccountOverviewStatus string

Status of the account.

const (
	AccountOverviewStatusNew         AccountOverviewStatus = "new"
	AccountOverviewStatusTrial       AccountOverviewStatus = "trial"
	AccountOverviewStatusTrialend    AccountOverviewStatus = "trialend"
	AccountOverviewStatusActive      AccountOverviewStatus = "active"
	AccountOverviewStatusIntegration AccountOverviewStatus = "integration"
	AccountOverviewStatusPaused      AccountOverviewStatus = "paused"
	AccountOverviewStatusPreparation AccountOverviewStatus = "preparation"
	AccountOverviewStatusReady       AccountOverviewStatus = "ready"
)

type AccountOverviewUser

type AccountOverviewUser struct {
	// User's ID.
	ID int64 `json:"id"`
	// Email confirmation:
	//
	// - `true` – user confirmed the email;
	// - `false` – user did not confirm the email.
	Activated bool `json:"activated"`
	// System field. List of auth types available for the account.
	//
	// Any of "password", "sso", "github", "google-oauth2".
	AuthTypes []string `json:"auth_types"`
	// User's account ID.
	Client float64 `json:"client"`
	// User's company.
	Company string `json:"company"`
	// Deletion flag. If `true` then user was deleted.
	Deleted bool `json:"deleted"`
	// User's email address.
	Email string `json:"email" format:"email"`
	// User's group in the current account.
	//
	// IAM supports 5 groups:
	//
	// - Users
	// - Administrators
	// - Engineers
	// - Purge and Prefetch only (API)
	// - Purge and Prefetch only (API+Web)
	Groups []AccountOverviewUserGroup `json:"groups"`
	// User's language.
	//
	// Defines language of the control panel and email messages.
	//
	// Any of "de", "en", "ru", "zh", "az".
	Lang string `json:"lang"`
	// User's name.
	Name string `json:"name,nullable"`
	// User's phone.
	Phone string `json:"phone,nullable"`
	// Services provider ID.
	Reseller int64 `json:"reseller"`
	// SSO authentication flag. If `true` then user can login via SAML SSO.
	SSOAuth bool `json:"sso_auth"`
	// Two-step verification:
	//
	// - `true` – user enabled two-step verification;
	// - `false` – user disabled two-step verification.
	TwoFa bool `json:"two_fa"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Activated   respjson.Field
		AuthTypes   respjson.Field
		Client      respjson.Field
		Company     respjson.Field
		Deleted     respjson.Field
		Email       respjson.Field
		Groups      respjson.Field
		Lang        respjson.Field
		Name        respjson.Field
		Phone       respjson.Field
		Reseller    respjson.Field
		SSOAuth     respjson.Field
		TwoFa       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountOverviewUser) RawJSON

func (r AccountOverviewUser) RawJSON() string

Returns the unmodified JSON received from the API

func (*AccountOverviewUser) UnmarshalJSON

func (r *AccountOverviewUser) UnmarshalJSON(data []byte) error

type AccountOverviewUserGroup

type AccountOverviewUserGroup struct {
	// Group's ID: Possible values are:
	//
	//   - 1 - Administrators* 2 - Users* 5 - Engineers* 3009 - Purge and Prefetch only
	//     (API+Web)* 3022 - Purge and Prefetch only (API)
	ID int64 `json:"id"`
	// Group's name.
	//
	// Any of "Users", "Administrators", "Engineers", "Purge and Prefetch only (API)",
	// "Purge and Prefetch only (API+Web)".
	Name string `json:"name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AccountOverviewUserGroup) RawJSON

func (r AccountOverviewUserGroup) RawJSON() string

Returns the unmodified JSON received from the API

func (*AccountOverviewUserGroup) UnmarshalJSON

func (r *AccountOverviewUserGroup) UnmarshalJSON(data []byte) error

type Error

type Error = apierror.Error

type IamService

type IamService struct {
	Options   []option.RequestOption
	APITokens APITokenService
	Users     UserService
}

IamService contains methods and other services that help with interacting with the gcore 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 NewIamService method instead.

func NewIamService

func NewIamService(opts ...option.RequestOption) (r IamService)

NewIamService 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 (*IamService) GetAccountOverview

func (r *IamService) GetAccountOverview(ctx context.Context, opts ...option.RequestOption) (res *AccountOverview, err error)

Get information about your profile, users and other account details.

type User

type User struct {
	// User's ID.
	ID int64 `json:"id"`
	// Email confirmation:
	//
	// - `true` – user confirmed the email;
	// - `false` – user did not confirm the email.
	Activated bool `json:"activated"`
	// System field. List of auth types available for the account.
	//
	// Any of "password", "sso", "github", "google-oauth2".
	AuthTypes []string `json:"auth_types"`
	// User's account ID.
	Client float64 `json:"client"`
	// User's company.
	Company string `json:"company"`
	// Deletion flag. If `true` then user was deleted.
	Deleted bool `json:"deleted"`
	// User's email address.
	Email string `json:"email" format:"email"`
	// User's group in the current account.
	//
	// IAM supports 5 groups:
	//
	// - Users
	// - Administrators
	// - Engineers
	// - Purge and Prefetch only (API)
	// - Purge and Prefetch only (API+Web)
	Groups []UserGroup `json:"groups"`
	// User's language.
	//
	// Defines language of the control panel and email messages.
	//
	// Any of "de", "en", "ru", "zh", "az".
	Lang UserLang `json:"lang"`
	// User's name.
	Name string `json:"name,nullable"`
	// User's phone.
	Phone string `json:"phone,nullable"`
	// Services provider ID.
	Reseller int64 `json:"reseller"`
	// SSO authentication flag. If `true` then user can login via SAML SSO.
	SSOAuth bool `json:"sso_auth"`
	// Two-step verification:
	//
	// - `true` – user enabled two-step verification;
	// - `false` – user disabled two-step verification.
	TwoFa bool `json:"two_fa"`
	// User's type.
	//
	// Any of "common".
	UserType UserUserType `json:"user_type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Activated   respjson.Field
		AuthTypes   respjson.Field
		Client      respjson.Field
		Company     respjson.Field
		Deleted     respjson.Field
		Email       respjson.Field
		Groups      respjson.Field
		Lang        respjson.Field
		Name        respjson.Field
		Phone       respjson.Field
		Reseller    respjson.Field
		SSOAuth     respjson.Field
		TwoFa       respjson.Field
		UserType    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (User) RawJSON

func (r User) RawJSON() string

Returns the unmodified JSON received from the API

func (*User) UnmarshalJSON

func (r *User) UnmarshalJSON(data []byte) error

type UserDeleteParams

type UserDeleteParams struct {
	ClientID int64 `path:"clientId,required" json:"-"`
	// contains filtered or unexported fields
}

type UserDetailed

type UserDetailed struct {
	// User's ID.
	ID int64 `json:"id,required"`
	// Email confirmation:
	//
	// - `true` – user confirmed the email;
	// - `false` – user did not confirm the email.
	Activated bool `json:"activated,required"`
	// System field. List of auth types available for the account.
	//
	// Any of "password", "sso", "github", "google-oauth2".
	AuthTypes []string `json:"auth_types,required"`
	// User's account ID.
	Client float64 `json:"client,required"`
	// List of user's clients. User can access to one or more clients.
	ClientAndRoles []UserDetailedClientAndRole `json:"client_and_roles,required"`
	// User's company.
	Company string `json:"company,required"`
	// Deletion flag. If `true` then user was deleted.
	Deleted bool `json:"deleted,required"`
	// User's email address.
	Email string `json:"email,required" format:"email"`
	// User's group in the current account.
	//
	// IAM supports 5 groups:
	//
	// - Users
	// - Administrators
	// - Engineers
	// - Purge and Prefetch only (API)
	// - Purge and Prefetch only (API+Web)
	Groups []UserDetailedGroup `json:"groups,required"`
	// User activity flag.
	IsActive bool `json:"is_active,required"`
	// User's language.
	//
	// Defines language of the control panel and email messages.
	//
	// Any of "de", "en", "ru", "zh", "az".
	Lang UserDetailedLang `json:"lang,required"`
	// User's name.
	Name string `json:"name,required"`
	// User's phone.
	Phone string `json:"phone,required"`
	// Services provider ID.
	Reseller int64 `json:"reseller,required"`
	// SSO authentication flag. If `true` then user can login via SAML SSO.
	SSOAuth bool `json:"sso_auth,required"`
	// Two-step verification:
	//
	// - `true` – user enabled two-step verification;
	// - `false` – user disabled two-step verification.
	TwoFa bool `json:"two_fa,required"`
	// User's type.
	//
	// Any of "common", "reseller", "seller".
	UserType UserDetailedUserType `json:"user_type,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		Activated      respjson.Field
		AuthTypes      respjson.Field
		Client         respjson.Field
		ClientAndRoles respjson.Field
		Company        respjson.Field
		Deleted        respjson.Field
		Email          respjson.Field
		Groups         respjson.Field
		IsActive       respjson.Field
		Lang           respjson.Field
		Name           respjson.Field
		Phone          respjson.Field
		Reseller       respjson.Field
		SSOAuth        respjson.Field
		TwoFa          respjson.Field
		UserType       respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UserDetailed) RawJSON

func (r UserDetailed) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserDetailed) UnmarshalJSON

func (r *UserDetailed) UnmarshalJSON(data []byte) error

type UserDetailedClientAndRole

type UserDetailedClientAndRole struct {
	ClientCompanyName string `json:"client_company_name,required"`
	ClientID          int64  `json:"client_id,required"`
	// User's ID.
	UserID int64 `json:"user_id,required"`
	// User role in this client.
	UserRoles []string `json:"user_roles,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ClientCompanyName respjson.Field
		ClientID          respjson.Field
		UserID            respjson.Field
		UserRoles         respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UserDetailedClientAndRole) RawJSON

func (r UserDetailedClientAndRole) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserDetailedClientAndRole) UnmarshalJSON

func (r *UserDetailedClientAndRole) UnmarshalJSON(data []byte) error

type UserDetailedGroup

type UserDetailedGroup struct {
	// Group's ID: Possible values are:
	//
	//   - 1 - Administrators* 2 - Users* 5 - Engineers* 3009 - Purge and Prefetch only
	//     (API+Web)* 3022 - Purge and Prefetch only (API)
	ID int64 `json:"id"`
	// Group's name.
	//
	// Any of "Users", "Administrators", "Engineers", "Purge and Prefetch only (API)",
	// "Purge and Prefetch only (API+Web)".
	Name string `json:"name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UserDetailedGroup) RawJSON

func (r UserDetailedGroup) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserDetailedGroup) UnmarshalJSON

func (r *UserDetailedGroup) UnmarshalJSON(data []byte) error

type UserDetailedLang

type UserDetailedLang string

User's language.

Defines language of the control panel and email messages.

const (
	UserDetailedLangDe UserDetailedLang = "de"
	UserDetailedLangEn UserDetailedLang = "en"
	UserDetailedLangRu UserDetailedLang = "ru"
	UserDetailedLangZh UserDetailedLang = "zh"
	UserDetailedLangAz UserDetailedLang = "az"
)

type UserDetailedUserType

type UserDetailedUserType string

User's type.

const (
	UserDetailedUserTypeCommon   UserDetailedUserType = "common"
	UserDetailedUserTypeReseller UserDetailedUserType = "reseller"
	UserDetailedUserTypeSeller   UserDetailedUserType = "seller"
)

type UserGroup

type UserGroup struct {
	// Group's ID: Possible values are:
	//
	//   - 1 - Administrators* 2 - Users* 5 - Engineers* 3009 - Purge and Prefetch only
	//     (API+Web)* 3022 - Purge and Prefetch only (API)
	ID int64 `json:"id"`
	// Group's name.
	//
	// Any of "Users", "Administrators", "Engineers", "Purge and Prefetch only (API)",
	// "Purge and Prefetch only (API+Web)".
	Name string `json:"name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UserGroup) RawJSON

func (r UserGroup) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserGroup) UnmarshalJSON

func (r *UserGroup) UnmarshalJSON(data []byte) error

type UserInvite

type UserInvite struct {
	// Status of the invitation.
	Status string `json:"status,required"`
	// Invited user ID.
	UserID int64 `json:"user_id,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status      respjson.Field
		UserID      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UserInvite) RawJSON

func (r UserInvite) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserInvite) UnmarshalJSON

func (r *UserInvite) UnmarshalJSON(data []byte) error

type UserInviteParams

type UserInviteParams struct {
	// ID of account.
	ClientID int64 `json:"client_id,required"`
	// User email.
	Email    string                   `json:"email,required" format:"email"`
	UserRole UserInviteParamsUserRole `json:"user_role,omitzero,required"`
	// User name.
	Name param.Opt[string] `json:"name,omitzero"`
	// User's language.
	//
	// Defines language of the control panel and email messages.
	//
	// Any of "de", "en", "ru", "zh", "az".
	Lang UserInviteParamsLang `json:"lang,omitzero"`
	// contains filtered or unexported fields
}

func (UserInviteParams) MarshalJSON

func (r UserInviteParams) MarshalJSON() (data []byte, err error)

func (*UserInviteParams) UnmarshalJSON

func (r *UserInviteParams) UnmarshalJSON(data []byte) error

type UserInviteParamsLang

type UserInviteParamsLang string

User's language.

Defines language of the control panel and email messages.

const (
	UserInviteParamsLangDe UserInviteParamsLang = "de"
	UserInviteParamsLangEn UserInviteParamsLang = "en"
	UserInviteParamsLangRu UserInviteParamsLang = "ru"
	UserInviteParamsLangZh UserInviteParamsLang = "zh"
	UserInviteParamsLangAz UserInviteParamsLang = "az"
)

type UserInviteParamsUserRole

type UserInviteParamsUserRole struct {
	// Group's ID: Possible values are:
	//
	//   - 1 - Administrators* 2 - Users* 5 - Engineers* 3009 - Purge and Prefetch only
	//     (API+Web)* 3022 - Purge and Prefetch only (API)
	ID param.Opt[int64] `json:"id,omitzero"`
	// Group's name.
	//
	// Any of "Users", "Administrators", "Engineers", "Purge and Prefetch only (API)",
	// "Purge and Prefetch only (API+Web)".
	Name string `json:"name,omitzero"`
	// contains filtered or unexported fields
}

func (UserInviteParamsUserRole) MarshalJSON

func (r UserInviteParamsUserRole) MarshalJSON() (data []byte, err error)

func (*UserInviteParamsUserRole) UnmarshalJSON

func (r *UserInviteParamsUserRole) UnmarshalJSON(data []byte) error

type UserLang

type UserLang string

User's language.

Defines language of the control panel and email messages.

const (
	UserLangDe UserLang = "de"
	UserLangEn UserLang = "en"
	UserLangRu UserLang = "ru"
	UserLangZh UserLang = "zh"
	UserLangAz UserLang = "az"
)

type UserListParams

type UserListParams struct {
	// The maximum number of items.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Offset relative to the beginning of list.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (UserListParams) URLQuery

func (r UserListParams) URLQuery() (v url.Values, err error)

URLQuery serializes UserListParams's query parameters as `url.Values`.

type UserService

type UserService struct {
	Options []option.RequestOption
}

UserService contains methods and other services that help with interacting with the gcore 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 NewUserService method instead.

func NewUserService

func NewUserService(opts ...option.RequestOption) (r UserService)

NewUserService 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 (*UserService) Delete

func (r *UserService) Delete(ctx context.Context, userID int64, body UserDeleteParams, opts ...option.RequestOption) (err error)

Revokes user's access to the specified account. If the specified user doesn't have access to multiple accounts, the user is deleted.

func (*UserService) Get

func (r *UserService) Get(ctx context.Context, userID int64, opts ...option.RequestOption) (res *UserDetailed, err error)

Get user's details

func (*UserService) Invite

func (r *UserService) Invite(ctx context.Context, body UserInviteParams, opts ...option.RequestOption) (res *UserInvite, err error)

Invite a user to the account.

User will receive an email. The new user will receive an invitation email with a link to create an account password, the existing user will be notified about the invitation to the account.

func (*UserService) List

func (r *UserService) List(ctx context.Context, query UserListParams, opts ...option.RequestOption) (res *pagination.OffsetPage[User], err error)

Get a list of users.

Pass a value for the `limit` parameter in your request if you want retrieve a paginated result. Otherwise API returns a list with all users without pagination.

func (*UserService) ListAutoPaging

Get a list of users.

Pass a value for the `limit` parameter in your request if you want retrieve a paginated result. Otherwise API returns a list with all users without pagination.

func (*UserService) Update

func (r *UserService) Update(ctx context.Context, userID int64, body UserUpdateParams, opts ...option.RequestOption) (res *UserUpdate, err error)

This method updates user's details.

type UserUpdate

type UserUpdate struct {
	// User's ID.
	ID int64 `json:"id,required"`
	// Email confirmation:
	//
	// - `true` – user confirmed the email;
	// - `false` – user did not confirm the email.
	Activated bool `json:"activated,required"`
	// System field. List of auth types available for the account.
	//
	// Any of "password", "sso", "github", "google-oauth2".
	AuthTypes []string `json:"auth_types,required"`
	// User's account ID.
	Client float64 `json:"client,required"`
	// List of user's clients. User can access to one or more clients.
	ClientAndRoles []UserUpdateClientAndRole `json:"client_and_roles,required"`
	// User's company.
	Company string `json:"company,required"`
	// Deletion flag. If `true` then user was deleted.
	Deleted bool `json:"deleted,required"`
	// User's email address.
	Email string `json:"email,required" format:"email"`
	// User's group in the current account.
	//
	// IAM supports 5 groups:
	//
	// - Users
	// - Administrators
	// - Engineers
	// - Purge and Prefetch only (API)
	// - Purge and Prefetch only (API+Web)
	Groups []UserUpdateGroup `json:"groups,required"`
	// User activity flag.
	IsActive bool `json:"is_active,required"`
	// User's language.
	//
	// Defines language of the control panel and email messages.
	//
	// Any of "de", "en", "ru", "zh", "az".
	Lang UserUpdateLang `json:"lang,required"`
	// User's name.
	Name string `json:"name,required"`
	// User's phone.
	Phone string `json:"phone,required"`
	// Services provider ID.
	Reseller int64 `json:"reseller,required"`
	// SSO authentication flag. If `true` then user can login via SAML SSO.
	SSOAuth bool `json:"sso_auth,required"`
	// Two-step verification:
	//
	// - `true` – user enabled two-step verification;
	// - `false` – user disabled two-step verification.
	TwoFa bool `json:"two_fa,required"`
	// User's type.
	//
	// Any of "common", "reseller", "seller".
	UserType UserUpdateUserType `json:"user_type,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		Activated      respjson.Field
		AuthTypes      respjson.Field
		Client         respjson.Field
		ClientAndRoles respjson.Field
		Company        respjson.Field
		Deleted        respjson.Field
		Email          respjson.Field
		Groups         respjson.Field
		IsActive       respjson.Field
		Lang           respjson.Field
		Name           respjson.Field
		Phone          respjson.Field
		Reseller       respjson.Field
		SSOAuth        respjson.Field
		TwoFa          respjson.Field
		UserType       respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UserUpdate) RawJSON

func (r UserUpdate) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserUpdate) UnmarshalJSON

func (r *UserUpdate) UnmarshalJSON(data []byte) error

type UserUpdateClientAndRole

type UserUpdateClientAndRole struct {
	ClientCompanyName string `json:"client_company_name,required"`
	ClientID          int64  `json:"client_id,required"`
	// User's ID.
	UserID int64 `json:"user_id,required"`
	// User role in this client.
	UserRoles []string `json:"user_roles,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ClientCompanyName respjson.Field
		ClientID          respjson.Field
		UserID            respjson.Field
		UserRoles         respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UserUpdateClientAndRole) RawJSON

func (r UserUpdateClientAndRole) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserUpdateClientAndRole) UnmarshalJSON

func (r *UserUpdateClientAndRole) UnmarshalJSON(data []byte) error

type UserUpdateGroup

type UserUpdateGroup struct {
	// Group's ID: Possible values are:
	//
	//   - 1 - Administrators* 2 - Users* 5 - Engineers* 3009 - Purge and Prefetch only
	//     (API+Web)* 3022 - Purge and Prefetch only (API)
	ID int64 `json:"id"`
	// Group's name.
	//
	// Any of "Users", "Administrators", "Engineers", "Purge and Prefetch only (API)",
	// "Purge and Prefetch only (API+Web)".
	Name string `json:"name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UserUpdateGroup) RawJSON

func (r UserUpdateGroup) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserUpdateGroup) UnmarshalJSON

func (r *UserUpdateGroup) UnmarshalJSON(data []byte) error

type UserUpdateLang

type UserUpdateLang string

User's language.

Defines language of the control panel and email messages.

const (
	UserUpdateLangDe UserUpdateLang = "de"
	UserUpdateLangEn UserUpdateLang = "en"
	UserUpdateLangRu UserUpdateLang = "ru"
	UserUpdateLangZh UserUpdateLang = "zh"
	UserUpdateLangAz UserUpdateLang = "az"
)

type UserUpdateParams

type UserUpdateParams struct {
	// User's name.
	Name param.Opt[string] `json:"name,omitzero"`
	// User's phone.
	Phone param.Opt[string] `json:"phone,omitzero"`
	// User's company.
	Company param.Opt[string] `json:"company,omitzero"`
	// User's email address.
	Email param.Opt[string] `json:"email,omitzero" format:"email"`
	// System field. List of auth types available for the account.
	//
	// Any of "password", "sso", "github", "google-oauth2".
	AuthTypes []string `json:"auth_types,omitzero"`
	// User's group in the current account.
	//
	// IAM supports 5 groups:
	//
	// - Users
	// - Administrators
	// - Engineers
	// - Purge and Prefetch only (API)
	// - Purge and Prefetch only (API+Web)
	Groups []UserUpdateParamsGroup `json:"groups,omitzero"`
	// User's language.
	//
	// Defines language of the control panel and email messages.
	//
	// Any of "de", "en", "ru", "zh", "az".
	Lang UserUpdateParamsLang `json:"lang,omitzero"`
	// contains filtered or unexported fields
}

func (UserUpdateParams) MarshalJSON

func (r UserUpdateParams) MarshalJSON() (data []byte, err error)

func (*UserUpdateParams) UnmarshalJSON

func (r *UserUpdateParams) UnmarshalJSON(data []byte) error

type UserUpdateParamsGroup

type UserUpdateParamsGroup struct {
	// Group's ID: Possible values are:
	//
	//   - 1 - Administrators* 2 - Users* 5 - Engineers* 3009 - Purge and Prefetch only
	//     (API+Web)* 3022 - Purge and Prefetch only (API)
	ID param.Opt[int64] `json:"id,omitzero"`
	// Group's name.
	//
	// Any of "Users", "Administrators", "Engineers", "Purge and Prefetch only (API)",
	// "Purge and Prefetch only (API+Web)".
	Name string `json:"name,omitzero"`
	// contains filtered or unexported fields
}

func (UserUpdateParamsGroup) MarshalJSON

func (r UserUpdateParamsGroup) MarshalJSON() (data []byte, err error)

func (*UserUpdateParamsGroup) UnmarshalJSON

func (r *UserUpdateParamsGroup) UnmarshalJSON(data []byte) error

type UserUpdateParamsLang

type UserUpdateParamsLang string

User's language.

Defines language of the control panel and email messages.

const (
	UserUpdateParamsLangDe UserUpdateParamsLang = "de"
	UserUpdateParamsLangEn UserUpdateParamsLang = "en"
	UserUpdateParamsLangRu UserUpdateParamsLang = "ru"
	UserUpdateParamsLangZh UserUpdateParamsLang = "zh"
	UserUpdateParamsLangAz UserUpdateParamsLang = "az"
)

type UserUpdateUserType

type UserUpdateUserType string

User's type.

const (
	UserUpdateUserTypeCommon   UserUpdateUserType = "common"
	UserUpdateUserTypeReseller UserUpdateUserType = "reseller"
	UserUpdateUserTypeSeller   UserUpdateUserType = "seller"
)

type UserUserType

type UserUserType string

User's type.

const (
	UserUserTypeCommon UserUserType = "common"
)

Jump to

Keyboard shortcuts

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