Documentation
¶
Overview ¶
This file is auto-generated, don't edit it. Thanks. Description:
This is for OpenApi SDK
Index ¶
- func DefaultAny(inputValue interface{}, defaultValue interface{}) (_result interface{})
- type Client
- func (client *Client) CallApi(params *Params, request *OpenApiRequest, runtime *util.RuntimeOptions) (_result map[string]interface{}, _err error)
- func (client *Client) CheckConfig(config *Config) (_err error)
- func (client *Client) DoROARequest(action *string, version *string, protocol *string, method *string, ...) (_result map[string]interface{}, _err error)
- func (client *Client) DoROARequestWithForm(action *string, version *string, protocol *string, method *string, ...) (_result map[string]interface{}, _err error)
- func (client *Client) DoRPCRequest(action *string, version *string, protocol *string, method *string, ...) (_result map[string]interface{}, _err error)
- func (client *Client) DoRequest(params *Params, request *OpenApiRequest, runtime *util.RuntimeOptions) (_result map[string]interface{}, _err error)
- func (client *Client) Execute(params *Params, request *OpenApiRequest, runtime *util.RuntimeOptions) (_result map[string]interface{}, _err error)
- func (client *Client) GetAccessKeyId() (_result *string, _err error)
- func (client *Client) GetAccessKeySecret() (_result *string, _err error)
- func (client *Client) GetBearerToken() (_result *string, _err error)
- func (client *Client) GetRpcHeaders() (_result map[string]*string, _err error)
- func (client *Client) GetSecurityToken() (_result *string, _err error)
- func (client *Client) GetType() (_result *string, _err error)
- func (client *Client) GetUserAgent() (_result *string)
- func (client *Client) Init(config *Config) (_err error)
- func (client *Client) SetGatewayClient(spi spi.ClientInterface) (_err error)
- func (client *Client) SetRpcHeaders(headers map[string]*string) (_err error)
- type Config
- func (s Config) GoString() string
- func (s *Config) SetAccessKeyId(v string) *Config
- func (s *Config) SetAccessKeySecret(v string) *Config
- func (s *Config) SetBearerToken(v string) *Config
- func (s *Config) SetCa(v string) *Config
- func (s *Config) SetCert(v string) *Config
- func (s *Config) SetConnectTimeout(v int) *Config
- func (s *Config) SetCredential(v credential.Credential) *Config
- func (s *Config) SetDisableHttp2(v bool) *Config
- func (s *Config) SetEndpoint(v string) *Config
- func (s *Config) SetEndpointType(v string) *Config
- func (s *Config) SetGlobalParameters(v *GlobalParameters) *Config
- func (s *Config) SetHttpProxy(v string) *Config
- func (s *Config) SetHttpsProxy(v string) *Config
- func (s *Config) SetKey(v string) *Config
- func (s *Config) SetMaxIdleConns(v int) *Config
- func (s *Config) SetMethod(v string) *Config
- func (s *Config) SetNetwork(v string) *Config
- func (s *Config) SetNoProxy(v string) *Config
- func (s *Config) SetOpenPlatformEndpoint(v string) *Config
- func (s *Config) SetProtocol(v string) *Config
- func (s *Config) SetReadTimeout(v int) *Config
- func (s *Config) SetRegionId(v string) *Config
- func (s *Config) SetSecurityToken(v string) *Config
- func (s *Config) SetSignatureAlgorithm(v string) *Config
- func (s *Config) SetSignatureVersion(v string) *Config
- func (s *Config) SetSocks5NetWork(v string) *Config
- func (s *Config) SetSocks5Proxy(v string) *Config
- func (s *Config) SetSuffix(v string) *Config
- func (s *Config) SetTlsMinVersion(v string) *Config
- func (s *Config) SetType(v string) *Config
- func (s *Config) SetUserAgent(v string) *Config
- func (s Config) String() string
- type GlobalParameters
- type OpenApiRequest
- func (s OpenApiRequest) GoString() string
- func (s *OpenApiRequest) SetBody(v interface{}) *OpenApiRequest
- func (s *OpenApiRequest) SetEndpointOverride(v string) *OpenApiRequest
- func (s *OpenApiRequest) SetHeaders(v map[string]*string) *OpenApiRequest
- func (s *OpenApiRequest) SetHostMap(v map[string]*string) *OpenApiRequest
- func (s *OpenApiRequest) SetQuery(v map[string]*string) *OpenApiRequest
- func (s *OpenApiRequest) SetStream(v io.Reader) *OpenApiRequest
- func (s OpenApiRequest) String() string
- type Params
- func (s Params) GoString() string
- func (s *Params) SetAction(v string) *Params
- func (s *Params) SetAuthType(v string) *Params
- func (s *Params) SetBodyType(v string) *Params
- func (s *Params) SetMethod(v string) *Params
- func (s *Params) SetPathname(v string) *Params
- func (s *Params) SetProtocol(v string) *Params
- func (s *Params) SetReqBodyType(v string) *Params
- func (s *Params) SetStyle(v string) *Params
- func (s *Params) SetVersion(v string) *Params
- func (s Params) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAny ¶
func DefaultAny(inputValue interface{}, defaultValue interface{}) (_result interface{})
Description:
If inputValue is not null, return it or return defaultValue ¶
@param inputValue - users input value
@param defaultValue - default value
@return the final result
Types ¶
type Client ¶
type Client struct {
Endpoint *string
RegionId *string
Protocol *string
Method *string
UserAgent *string
EndpointRule *string
EndpointMap map[string]*string
Suffix *string
ReadTimeout *int
ConnectTimeout *int
HttpProxy *string
HttpsProxy *string
Socks5Proxy *string
Socks5NetWork *string
NoProxy *string
Network *string
ProductId *string
MaxIdleConns *int
EndpointType *string
OpenPlatformEndpoint *string
Credential credential.Credential
SignatureVersion *string
SignatureAlgorithm *string
Headers map[string]*string
Spi spi.ClientInterface
GlobalParameters *GlobalParameters
Key *string
Cert *string
Ca *string
DisableHttp2 *bool
TlsMinVersion *string
}
func NewClient ¶
Description:
Init client with Config ¶
@param config - config contains the necessary information to create a client
func (*Client) CallApi ¶
func (client *Client) CallApi(params *Params, request *OpenApiRequest, runtime *util.RuntimeOptions) (_result map[string]interface{}, _err error)
func (*Client) CheckConfig ¶
Description:
If the endpointRule and config.endpoint are empty, throw error ¶
@param config - config contains the necessary information to create a client
func (*Client) DoROARequest ¶
func (client *Client) DoROARequest(action *string, version *string, protocol *string, method *string, authType *string, pathname *string, bodyType *string, request *OpenApiRequest, runtime *util.RuntimeOptions) (_result map[string]interface{}, _err error)
Description:
Encapsulate the request and invoke the network ¶
@param action - api name
@param version - product version
@param protocol - http or https
@param method - e.g. GET
@param authType - authorization type e.g. AK
@param pathname - pathname of every api
@param bodyType - response body type e.g. String
@param request - object of OpenApiRequest
@param runtime - which controls some details of call api, such as retry times
@return the response
func (*Client) DoROARequestWithForm ¶
func (client *Client) DoROARequestWithForm(action *string, version *string, protocol *string, method *string, authType *string, pathname *string, bodyType *string, request *OpenApiRequest, runtime *util.RuntimeOptions) (_result map[string]interface{}, _err error)
Description:
Encapsulate the request and invoke the network with form body ¶
@param action - api name
@param version - product version
@param protocol - http or https
@param method - e.g. GET
@param authType - authorization type e.g. AK
@param pathname - pathname of every api
@param bodyType - response body type e.g. String
@param request - object of OpenApiRequest
@param runtime - which controls some details of call api, such as retry times
@return the response
func (*Client) DoRPCRequest ¶
func (client *Client) DoRPCRequest(action *string, version *string, protocol *string, method *string, authType *string, bodyType *string, request *OpenApiRequest, runtime *util.RuntimeOptions) (_result map[string]interface{}, _err error)
Description:
Encapsulate the request and invoke the network ¶
@param action - api name
@param version - product version
@param protocol - http or https
@param method - e.g. GET
@param authType - authorization type e.g. AK
@param bodyType - response body type e.g. String
@param request - object of OpenApiRequest
@param runtime - which controls some details of call api, such as retry times
@return the response
func (*Client) DoRequest ¶
func (client *Client) DoRequest(params *Params, request *OpenApiRequest, runtime *util.RuntimeOptions) (_result map[string]interface{}, _err error)
Description:
Encapsulate the request and invoke the network ¶
@param action - api name
@param version - product version
@param protocol - http or https
@param method - e.g. GET
@param authType - authorization type e.g. AK
@param bodyType - response body type e.g. String
@param request - object of OpenApiRequest
@param runtime - which controls some details of call api, such as retry times
@return the response
func (*Client) Execute ¶
func (client *Client) Execute(params *Params, request *OpenApiRequest, runtime *util.RuntimeOptions) (_result map[string]interface{}, _err error)
Description:
Encapsulate the request and invoke the network ¶
@param action - api name
@param version - product version
@param protocol - http or https
@param method - e.g. GET
@param authType - authorization type e.g. AK
@param bodyType - response body type e.g. String
@param request - object of OpenApiRequest
@param runtime - which controls some details of call api, such as retry times
@return the response
func (*Client) GetAccessKeyId ¶
Description:
Get accesskey id by using credential ¶
@return accesskey id
func (*Client) GetAccessKeySecret ¶
Description:
Get accesskey secret by using credential ¶
@return accesskey secret
func (*Client) GetSecurityToken ¶
Description:
Get security token by using credential ¶
@return security token
func (*Client) GetType ¶
Description:
Get credential type by credential ¶
@return credential type e.g. access_key
func (*Client) SetGatewayClient ¶ added in v2.0.2
func (client *Client) SetGatewayClient(spi spi.ClientInterface) (_err error)
Description:
set gateway client
@param spi - .
type Config ¶
type Config struct {
// accesskey id
AccessKeyId *string `json:"accessKeyId,omitempty" xml:"accessKeyId,omitempty"`
// accesskey secret
AccessKeySecret *string `json:"accessKeySecret,omitempty" xml:"accessKeySecret,omitempty"`
// security token
//
// example:
//
// a.txt
SecurityToken *string `json:"securityToken,omitempty" xml:"securityToken,omitempty"`
// bearer token
//
// example:
//
// the-bearer-token
BearerToken *string `json:"bearerToken,omitempty" xml:"bearerToken,omitempty"`
// http protocol
//
// example:
//
// http
Protocol *string `json:"protocol,omitempty" xml:"protocol,omitempty"`
// http method
//
// example:
//
// GET
Method *string `json:"method,omitempty" xml:"method,omitempty"`
// region id
//
// example:
//
// cn-hangzhou
RegionId *string `json:"regionId,omitempty" xml:"regionId,omitempty"`
// read timeout
//
// example:
//
// 10
ReadTimeout *int `json:"readTimeout,omitempty" xml:"readTimeout,omitempty"`
// connect timeout
//
// example:
//
// 10
ConnectTimeout *int `json:"connectTimeout,omitempty" xml:"connectTimeout,omitempty"`
// http proxy
//
// example:
//
// http://localhost
HttpProxy *string `json:"httpProxy,omitempty" xml:"httpProxy,omitempty"`
// https proxy
//
// example:
//
// https://localhost
HttpsProxy *string `json:"httpsProxy,omitempty" xml:"httpsProxy,omitempty"`
// credential
Credential credential.Credential `json:"credential,omitempty" xml:"credential,omitempty"`
// endpoint
//
// example:
//
// cs.aliyuncs.com
Endpoint *string `json:"endpoint,omitempty" xml:"endpoint,omitempty"`
// proxy white list
//
// example:
//
// http://localhost
NoProxy *string `json:"noProxy,omitempty" xml:"noProxy,omitempty"`
// max idle conns
//
// example:
//
// 3
MaxIdleConns *int `json:"maxIdleConns,omitempty" xml:"maxIdleConns,omitempty"`
// network for endpoint
//
// example:
//
// public
Network *string `json:"network,omitempty" xml:"network,omitempty"`
// user agent
//
// example:
//
// Alibabacloud/1
UserAgent *string `json:"userAgent,omitempty" xml:"userAgent,omitempty"`
// suffix for endpoint
//
// example:
//
// aliyun
Suffix *string `json:"suffix,omitempty" xml:"suffix,omitempty"`
// socks5 proxy
Socks5Proxy *string `json:"socks5Proxy,omitempty" xml:"socks5Proxy,omitempty"`
// socks5 network
//
// example:
//
// TCP
Socks5NetWork *string `json:"socks5NetWork,omitempty" xml:"socks5NetWork,omitempty"`
// endpoint type
//
// example:
//
// internal
EndpointType *string `json:"endpointType,omitempty" xml:"endpointType,omitempty"`
// OpenPlatform endpoint
//
// example:
//
// openplatform.aliyuncs.com
OpenPlatformEndpoint *string `json:"openPlatformEndpoint,omitempty" xml:"openPlatformEndpoint,omitempty"`
// Deprecated
//
// credential type
//
// example:
//
// access_key
Type *string `json:"type,omitempty" xml:"type,omitempty"`
// Signature Version
//
// example:
//
// v1
SignatureVersion *string `json:"signatureVersion,omitempty" xml:"signatureVersion,omitempty"`
// Signature Algorithm
//
// example:
//
// ACS3-HMAC-SHA256
SignatureAlgorithm *string `json:"signatureAlgorithm,omitempty" xml:"signatureAlgorithm,omitempty"`
// Global Parameters
GlobalParameters *GlobalParameters `json:"globalParameters,omitempty" xml:"globalParameters,omitempty"`
// privite key for client certificate
//
// example:
//
// MIIEvQ
Key *string `json:"key,omitempty" xml:"key,omitempty"`
// client certificate
//
// example:
//
// -----BEGIN CERTIFICATE-----
//
// xxx-----END CERTIFICATE-----
Cert *string `json:"cert,omitempty" xml:"cert,omitempty"`
// server certificate
//
// example:
//
// -----BEGIN CERTIFICATE-----
//
// xxx-----END CERTIFICATE-----
Ca *string `json:"ca,omitempty" xml:"ca,omitempty"`
// disable HTTP/2
//
// example:
//
// false
DisableHttp2 *bool `json:"disableHttp2,omitempty" xml:"disableHttp2,omitempty"`
// TLS Minimum Version
//
// example:
//
// TLSv1, TLSv1.1, TLSv1.2, TLSv1.3
TlsMinVersion *string `json:"tlsMinVersion,omitempty" xml:"tlsMinVersion,omitempty"`
}
Description:
Model for initing client
func (*Config) SetAccessKeyId ¶
func (*Config) SetAccessKeySecret ¶
func (*Config) SetBearerToken ¶ added in v2.0.8
func (*Config) SetConnectTimeout ¶
func (*Config) SetCredential ¶
func (s *Config) SetCredential(v credential.Credential) *Config
func (*Config) SetDisableHttp2 ¶ added in v2.0.7
func (*Config) SetEndpoint ¶
func (*Config) SetEndpointType ¶
func (*Config) SetGlobalParameters ¶
func (s *Config) SetGlobalParameters(v *GlobalParameters) *Config
func (*Config) SetHttpProxy ¶
func (*Config) SetHttpsProxy ¶
func (*Config) SetMaxIdleConns ¶
func (*Config) SetNetwork ¶
func (*Config) SetNoProxy ¶
func (*Config) SetOpenPlatformEndpoint ¶
func (*Config) SetProtocol ¶
func (*Config) SetReadTimeout ¶
func (*Config) SetRegionId ¶
func (*Config) SetSecurityToken ¶
func (*Config) SetSignatureAlgorithm ¶
func (*Config) SetSignatureVersion ¶
func (*Config) SetSocks5NetWork ¶
func (*Config) SetSocks5Proxy ¶
func (*Config) SetTlsMinVersion ¶ added in v2.0.11
func (*Config) SetUserAgent ¶
type GlobalParameters ¶
type GlobalParameters struct {
Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"`
Queries map[string]*string `json:"queries,omitempty" xml:"queries,omitempty"`
}
func (GlobalParameters) GoString ¶
func (s GlobalParameters) GoString() string
func (*GlobalParameters) SetHeaders ¶
func (s *GlobalParameters) SetHeaders(v map[string]*string) *GlobalParameters
func (*GlobalParameters) SetQueries ¶
func (s *GlobalParameters) SetQueries(v map[string]*string) *GlobalParameters
func (GlobalParameters) String ¶
func (s GlobalParameters) String() string
type OpenApiRequest ¶
type OpenApiRequest struct {
Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"`
Query map[string]*string `json:"query,omitempty" xml:"query,omitempty"`
Body interface{} `json:"body,omitempty" xml:"body,omitempty"`
Stream io.Reader `json:"stream,omitempty" xml:"stream,omitempty"`
HostMap map[string]*string `json:"hostMap,omitempty" xml:"hostMap,omitempty"`
EndpointOverride *string `json:"endpointOverride,omitempty" xml:"endpointOverride,omitempty"`
}
func (OpenApiRequest) GoString ¶
func (s OpenApiRequest) GoString() string
func (*OpenApiRequest) SetBody ¶
func (s *OpenApiRequest) SetBody(v interface{}) *OpenApiRequest
func (*OpenApiRequest) SetEndpointOverride ¶
func (s *OpenApiRequest) SetEndpointOverride(v string) *OpenApiRequest
func (*OpenApiRequest) SetHeaders ¶
func (s *OpenApiRequest) SetHeaders(v map[string]*string) *OpenApiRequest
func (*OpenApiRequest) SetHostMap ¶
func (s *OpenApiRequest) SetHostMap(v map[string]*string) *OpenApiRequest
func (*OpenApiRequest) SetQuery ¶
func (s *OpenApiRequest) SetQuery(v map[string]*string) *OpenApiRequest
func (*OpenApiRequest) SetStream ¶
func (s *OpenApiRequest) SetStream(v io.Reader) *OpenApiRequest
func (OpenApiRequest) String ¶
func (s OpenApiRequest) String() string
type Params ¶
type Params struct {
Action *string `json:"action,omitempty" xml:"action,omitempty" require:"true"`
Version *string `json:"version,omitempty" xml:"version,omitempty" require:"true"`
Protocol *string `json:"protocol,omitempty" xml:"protocol,omitempty" require:"true"`
Pathname *string `json:"pathname,omitempty" xml:"pathname,omitempty" require:"true"`
Method *string `json:"method,omitempty" xml:"method,omitempty" require:"true"`
AuthType *string `json:"authType,omitempty" xml:"authType,omitempty" require:"true"`
BodyType *string `json:"bodyType,omitempty" xml:"bodyType,omitempty" require:"true"`
ReqBodyType *string `json:"reqBodyType,omitempty" xml:"reqBodyType,omitempty" require:"true"`
Style *string `json:"style,omitempty" xml:"style,omitempty"`
}