applications

package
v0.0.0-...-63319d1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MPL-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(client *golangsdk.ServiceClient, instanceId string, opts ListOptsBuilder) pagination.Pager

List is a method to obtain an array of one or more APIG applications according to the query parameters.

func ListAppCode

func ListAppCode(client *golangsdk.ServiceClient, instanceId, appId string, opts ListCodeOptsBuilder) pagination.Pager

ListAppCode is a method to obtain the application code list of the specified application of the specified instance.

Types

type AppCode

type AppCode struct {
	// AppCode value, which contains 64 to 180 characters, starting with a letter, plus sign (+) or slash (/).
	// Only letters and the following special characters are allowed: +-_!@#$%/=
	Code string `json:"app_code"`
	// AppCode ID.
	Id string `json:"id"`
	// App ID.
	AppId string `json:"app_id"`
	// Creation time, in UTC format.
	CreateTime string `json:"create_time"`
}

func ExtractAppCodes

func ExtractAppCodes(r pagination.Page) ([]AppCode, error)

type AppCodeOpts

type AppCodeOpts struct {
	// AppCode value, which contains 64 to 180 characters, starting with a letter, plus sign (+) or slash (/).
	// Only letters and the following special characters are allowed: +-_!@#$%/=
	AppCode string `json:"app_code" required:"true"`
}

AppCodeOpts allows to create an application code using given parameters.

func (AppCodeOpts) ToAppCodeOptsMap

func (opts AppCodeOpts) ToAppCodeOptsMap() (map[string]interface{}, error)

type AppCodeOptsBuilder

type AppCodeOptsBuilder interface {
	ToAppCodeOptsMap() (map[string]interface{}, error)
}

type AppCodePage

type AppCodePage struct {
	pagination.SinglePageBase
}

AppCodePage represents the response pages of the ListAppCode operation.

type AppOpts

type AppOpts struct {
	// Application name, which can contain 3 to 64 characters, starting with a letter.
	// Only letters, digits and underscores (_) are allowed.
	Name string `json:"name" required:"true"`
	// Description of the application, which can contain a maximum of 255 characters.
	// Chinese characters must be in UTF-8 or Unicode format.
	Description string `json:"remark,omitempty"`
	// Application key, which can contain 8 to 64 characters, starting with a letter or digit.
	// Only letters, digits, hyphens (-) and underscores (_) are allowed.
	AppKey string `json:"app_key,omitempty"`
	// Application secret, which can contain 8 to 64 characters, starting with a letter or digit.
	// Only letters, digits and the following special characters are allowed: _-!@#$%
	AppSecret string `json:"app_secret,omitempty"`
}

AppOpts allows to create or update an application using given parameters.

func (AppOpts) ToAppOptsMap

func (opts AppOpts) ToAppOptsMap() (map[string]interface{}, error)

type AppOptsBuilder

type AppOptsBuilder interface {
	ToAppOptsMap() (map[string]interface{}, error)
}

type Application

type Application struct {
	// Creator of the application.
	//     USER: The app is created by the API user.
	//     MARKET: The app is allocated by the marketplace.
	Creator string `json:"creator"`
	// Registration time.
	RegistrationTime string `json:"register_time"`
	// Update time.
	UpdateTime string `json:"update_time"`
	// App key.
	AppKey string `json:"app_key"`
	// App name.
	Name string `json:"name"`
	// Description.
	Description string `json:"remark"`
	// ID.
	Id string `json:"id"`
	// App secret.
	AppSecret string `json:"app_secret"`
	// App status.
	Status int `json:"status"`
	// App type, Currently only supports 'apig'. List method are not support.
	Type string `json:"app_type"`
	// Number of APIs. Only used for List method.
	BindNum int `json:"bind_num"`
}

func ExtractApplications

func ExtractApplications(r pagination.Page) ([]Application, error)

type ApplicationPage

type ApplicationPage struct {
	pagination.SinglePageBase
}

ApplicationPage represents the response pages of the List operation.

type AutoGenerateCodeResult

type AutoGenerateCodeResult struct {
	CodeResult
}

AutoGenerateCodeResult represents a result of the AutoGenerateAppCode method.

func AutoGenerateAppCode

func AutoGenerateAppCode(client *golangsdk.ServiceClient, instanceId, appId string) (r AutoGenerateCodeResult)

AutoGenerateAppCode is a method used to automatically create code in a specified application.

type CodeResult

type CodeResult struct {
	golangsdk.Result
}

func (CodeResult) Extract

func (r CodeResult) Extract() (*AppCode, error)

type CreateCodeResult

type CreateCodeResult struct {
	CodeResult
}

CreateCodeResult represents a result of the CreateAppCode method.

func CreateAppCode

func CreateAppCode(client *golangsdk.ServiceClient, instanceId, appId string,
	opts AppCodeOptsBuilder) (r CreateCodeResult)

CreateAppCode is a method by which to create function that create a code at sepcified APIG application using instanceId, appId and AppCodeOpts (code value).

type CreateResult

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

CreateResult represents a result of the Create method.

func Create

func Create(client *golangsdk.ServiceClient, instanceId string, opts AppOptsBuilder) (r CreateResult)

Create is a method by which to create function that create a APIG application.

func (CreateResult) Extract

func (r CreateResult) Extract() (*Application, error)

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult represents a result of the Delete method.

func Delete

func Delete(client *golangsdk.ServiceClient, instanceId, appId string) (r DeleteResult)

Delete is a method to delete an existing application.

func RemoveAppCode

func RemoveAppCode(client *golangsdk.ServiceClient, instanceId, appId, codeId string) (r DeleteResult)

RemoveAppCode is a method to delete an existing code from a specified application.

type GetCodeResult

type GetCodeResult struct {
	CodeResult
}

GetCodeResult represents a result of the GetAppCode method.

func GetAppCode

func GetAppCode(client *golangsdk.ServiceClient, instanceId, appId, codeId string) (r GetCodeResult)

GetAppCode is a method to obtain the specified code of the specified application of the specified instance using instanceId, appId and codeId.

type GetResult

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

GetResult represents a result of the Get operation.

func Get

func Get(client *golangsdk.ServiceClient, instanceId, appId string) (r GetResult)

Get is a method to obtain the specified application according to the instanceId and appId.

func (GetResult) Extract

func (r GetResult) Extract() (*Application, error)

type ListCodeOpts

type ListCodeOpts struct {
	// Offset from which the query starts.
	// If the offset is less than 0, the value is automatically converted to 0. Default to 0.
	Offset int `q:"offset"`
	// Number of items displayed on each page.
	Limit int `q:"limit"`
}

ListCodeOpts allows to filter application code list data using given parameters.

func (ListCodeOpts) ToAppCodeListQuery

func (opts ListCodeOpts) ToAppCodeListQuery() (string, error)

type ListCodeOptsBuilder

type ListCodeOptsBuilder interface {
	ToAppCodeListQuery() (string, error)
}

type ListOpts

type ListOpts struct {
	// App ID.
	Id string `q:"id"`
	// App name.
	Name string `q:"name"`
	// App status.
	Status string `q:"status"`
	// App key.
	AppKey string `q:"app_key"`
	// Creator of the application.
	//     USER: The app is created by the API user.
	//     MARKET: The app is allocated by the marketplace.
	Creator string `q:"creator"`
	// Offset from which the query starts.
	// If the offset is less than 0, the value is automatically converted to 0. Default to 0.
	Offset int `q:"offset"`
	// Number of items displayed on each page.
	Limit int `q:"limit"`
	// Parameter name (name) for exact matching.
	PreciseSearch string `q:"precise_search"`
}

ListOpts allows to filter list data using given parameters.

func (ListOpts) ToAppListQuery

func (opts ListOpts) ToAppListQuery() (string, error)

type ListOptsBuilder

type ListOptsBuilder interface {
	ToAppListQuery() (string, error)
}

type ResetSecretResult

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

ResetSecretResult represents a result of the ResetAppSecret operation.

func ResetAppSecret

func ResetAppSecret(client *golangsdk.ServiceClient, instanceId, appId string,
	opts SecretResetOptsBuilder) (r ResetSecretResult)

func (ResetSecretResult) Extract

func (r ResetSecretResult) Extract() (*Application, error)

type SecretResetOpts

type SecretResetOpts struct {
	AppSecret string `json:"app_secret"`
}

SecretResetOpts allows to reset application secret value using given parameters.

func (SecretResetOpts) ToSecretResetOptsMap

func (opts SecretResetOpts) ToSecretResetOptsMap() (map[string]interface{}, error)

type SecretResetOptsBuilder

type SecretResetOptsBuilder interface {
	ToSecretResetOptsMap() (map[string]interface{}, error)
}

type UpdateResult

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

UpdateResult represents a result of the Update operation.

func Update

func Update(client *golangsdk.ServiceClient, instanceId, appId string, opts AppOptsBuilder) (r UpdateResult)

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Application, error)

Jump to

Keyboard shortcuts

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