Documentation ¶
Index ¶
- func List(client *golangsdk.ServiceClient, opts ListOptsBuilder) pagination.Pager
- type CreateResult
- type DeleteResult
- type GetResult
- type GetSpecRespResult
- type ListOpts
- type ListOptsBuilder
- type Response
- type ResponseInfo
- type ResponseInfoHeader
- type ResponseOpts
- type ResponseOptsBuilder
- type ResponsePage
- type SpecRespOpts
- type SpecRespOptsBuilder
- type SpecRespResult
- type UpdateResult
- type UpdateSpecRespBuilder
- type UpdateSpecRespResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(client *golangsdk.ServiceClient, opts ListOptsBuilder) pagination.Pager
List is a method to obtain an array of one or more custom reponses according to the query parameters.
Types ¶
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, opts ResponseOptsBuilder) (r CreateResult)
Create is a method by which to create function that create a new custom response.
type DeleteResult ¶
DeleteResult represents a result of the Delete and DeleteSpecResp method.
func Delete ¶
func Delete(client *golangsdk.ServiceClient, instanceId, groupId, respId string) (r DeleteResult)
Delete is a method to delete the existing custom response.
func DeleteSpecResp ¶
func DeleteSpecResp(client *golangsdk.ServiceClient, respType string, specOpts SpecRespOptsBuilder) (r DeleteResult)
DeleteSpecResp is a method to delete an existing custom response configuration from an group.
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult represents a result of the Get operation.
type GetSpecRespResult ¶
type GetSpecRespResult struct {
SpecRespResult
}
GetSpecRespResult represents a result of the GetSpecResp method.
func GetSpecResp ¶
func GetSpecResp(client *golangsdk.ServiceClient, respType string, opts SpecRespOptsBuilder) (r GetSpecRespResult)
GetSpecResp is a method to get the specifies custom response configuration from an group.
type ListOpts ¶
type ListOpts 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. The valid values are range form 1 to 500, default to 20. Limit int `q:"limit"` // APIG dedicated instance ID. InstanceId string `json:"-"` // APIG group ID. GroupId string `json:"-"` }
ListOpts allows to filter list data using given parameters.
func (ListOpts) GetGroupId ¶
func (ListOpts) GetInstanceId ¶
func (ListOpts) ToListQuery ¶
type ListOptsBuilder ¶
type Response ¶
type Response struct { // Response ID. Id string `json:"id"` // Response name. Name string `json:"name"` // Response type definition, which includes a key and value. Options of the key: // AUTH_FAILURE: Authentication failed. // AUTH_HEADER_MISSING: The identity source is missing. // AUTHORIZER_FAILURE: Custom authentication failed. // AUTHORIZER_CONF_FAILURE: There has been a custom authorizer error. // AUTHORIZER_IDENTITIES_FAILURE: The identity source of the custom authorizer is invalid. // BACKEND_UNAVAILABLE: The backend service is unavailable. // BACKEND_TIMEOUT: Communication with the backend service timed out. // THROTTLED: The request was rejected due to request throttling. // UNAUTHORIZED: The app you are using has not been authorized to call the API. // ACCESS_DENIED: Access denied. // NOT_FOUND: No API is found. // REQUEST_PARAMETERS_FAILURE: The request parameters are incorrect. // DEFAULT_4XX: Another 4XX error occurred. // DEFAULT_5XX: Another 5XX error occurred. // Each error type is in JSON format. Responses map[string]ResponseInfo `json:"responses"` // Indicates whether the group response is the default response. IsDefault bool `json:"default"` // Creation time. CreateTime string `json:"create_time"` // Update time. UpdateTime string `json:"update_time"` }
func ExtractResponses ¶
func ExtractResponses(r pagination.Page) ([]Response, error)
ExtractResponses is a method to extract an response struct list.
type ResponseInfo ¶
type ResponseInfo struct { // Response body template. Body string `json:"body" required:"true"` // HTTP status code of the response. If omitted, the status will be cancelled. Status int `json:"status,omitempty"` // The configuration of the custom response headers. Headers []ResponseInfoHeader `json:"headers,omitempty"` // Indicates whether the response is the default response. // Only the response of the API call is supported. IsDefault bool `json:"default,omitempty"` }
func (ResponseInfo) ToSpecRespUpdateMap ¶
func (opts ResponseInfo) ToSpecRespUpdateMap() (map[string]interface{}, error)
type ResponseInfoHeader ¶
type ResponseInfoHeader struct { // The key name of the response header. // The valid length is limited from 1 to 128, only English letters, digits and hyphens (-) are allowed. Key string `json:"key,omitempty"` // The value for the specified response header key. // The valid length is limited from 1 to 1,024. Value string `json:"value,omitempty"` }
type ResponseOpts ¶
type ResponseOpts struct { // APIG group name, which can contain 1 to 64 characters, only letters, digits, hyphens (-) and // underscores (_) are allowed. Name string `json:"name" required:"true"` // Response type definition, which includes a key and value. Options of the key: // AUTH_FAILURE: Authentication failed. // AUTH_HEADER_MISSING: The identity source is missing. // AUTHORIZER_FAILURE: Custom authentication failed. // AUTHORIZER_CONF_FAILURE: There has been a custom authorizer error. // AUTHORIZER_IDENTITIES_FAILURE: The identity source of the custom authorizer is invalid. // BACKEND_UNAVAILABLE: The backend service is unavailable. // BACKEND_TIMEOUT: Communication with the backend service timed out. // THROTTLED: The request was rejected due to request throttling. // UNAUTHORIZED: The app you are using has not been authorized to call the API. // ACCESS_DENIED: Access denied. // NOT_FOUND: No API is found. // REQUEST_PARAMETERS_FAILURE: The request parameters are incorrect. // DEFAULT_4XX: Another 4XX error occurred. // DEFAULT_5XX: Another 5XX error occurred. // Each error type is in JSON format. Responses map[string]ResponseInfo `json:"responses,omitempty"` // APIG dedicated instance ID. InstanceId string `json:"-"` // APIG group ID. GroupId string `json:"-"` }
ResponseOpts allows to create a new custom response or update the existing custom response using given parameters.
func (ResponseOpts) GetGroupId ¶
func (opts ResponseOpts) GetGroupId() string
func (ResponseOpts) GetInstanceId ¶
func (opts ResponseOpts) GetInstanceId() string
func (ResponseOpts) ToResponseOptsMap ¶
func (opts ResponseOpts) ToResponseOptsMap() (map[string]interface{}, error)
type ResponseOptsBuilder ¶
type ResponsePage ¶
type ResponsePage struct {
pagination.SinglePageBase
}
ResponsePage represents the response pages of the List operation.
type SpecRespOpts ¶
SpecRespOpts is used to build the APIG response url. All parameters are required.
func (SpecRespOpts) GetGroupId ¶
func (opts SpecRespOpts) GetGroupId() string
func (SpecRespOpts) GetInstanceId ¶
func (opts SpecRespOpts) GetInstanceId() string
func (SpecRespOpts) GetResponseId ¶
func (opts SpecRespOpts) GetResponseId() string
type SpecRespOptsBuilder ¶
type SpecRespResult ¶
type SpecRespResult struct {
// contains filtered or unexported fields
}
func (SpecRespResult) ExtractSpecResp ¶
func (r SpecRespResult) ExtractSpecResp(key string) (*ResponseInfo, error)
ExtractSpecResp is a method to extract an response struct using a specifies key.
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, respId string, opts ResponseOptsBuilder) (r UpdateResult)
Update is a method by which to create function that udpate the existing custom response.
type UpdateSpecRespBuilder ¶
type UpdateSpecRespResult ¶
type UpdateSpecRespResult struct {
SpecRespResult
}
UpdateSpecRespResult represents a result of the UpdateSpecResp method.
func UpdateSpecResp ¶
func UpdateSpecResp(client *golangsdk.ServiceClient, respType string, specOpts SpecRespOptsBuilder, respOpts UpdateSpecRespBuilder) (r UpdateSpecRespResult)
UpdateSpecResp is a method to update an existing custom response configuration from an group.