-
Notifications
You must be signed in to change notification settings - Fork 9
/
AliyunCosmoGatewayInvokeAPIRequest.go
94 lines (79 loc) · 2.67 KB
/
AliyunCosmoGatewayInvokeAPIRequest.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package yunos
import (
"net/url"
"sync"
"github.com/bububa/opentaobao/model"
)
// AliyunCosmoGatewayInvokeAPIRequest alios cosmo服务调用 API请求
// aliyun.cosmo.gateway.invoke
//
// AliOS cosmo服务分发平台对外调用接口
type AliyunCosmoGatewayInvokeAPIRequest struct {
model.Params
// 请求上下文参数
_context *RdamContext
// 请求对象
_rdamRequest *RdamGenericRequest
}
// NewAliyunCosmoGatewayInvokeRequest 初始化AliyunCosmoGatewayInvokeAPIRequest对象
func NewAliyunCosmoGatewayInvokeRequest() *AliyunCosmoGatewayInvokeAPIRequest {
return &AliyunCosmoGatewayInvokeAPIRequest{
Params: model.NewParams(2),
}
}
// Reset IRequest interface 方法, 清空结构体
func (r *AliyunCosmoGatewayInvokeAPIRequest) Reset() {
r._context = nil
r._rdamRequest = nil
r.Params.ToZero()
}
// GetApiMethodName IRequest interface 方法, 获取Api method
func (r AliyunCosmoGatewayInvokeAPIRequest) GetApiMethodName() string {
return "aliyun.cosmo.gateway.invoke"
}
// GetApiParams IRequest interface 方法, 获取API参数
func (r AliyunCosmoGatewayInvokeAPIRequest) GetApiParams(params url.Values) {
for k, v := range r.Params {
params.Set(k, v.String())
}
}
// GetRawParams IRequest interface 方法, 获取API原始参数
func (r AliyunCosmoGatewayInvokeAPIRequest) GetRawParams() model.Params {
return r.Params
}
// SetContext is Context Setter
// 请求上下文参数
func (r *AliyunCosmoGatewayInvokeAPIRequest) SetContext(_context *RdamContext) error {
r._context = _context
r.Set("context", _context)
return nil
}
// GetContext Context Getter
func (r AliyunCosmoGatewayInvokeAPIRequest) GetContext() *RdamContext {
return r._context
}
// SetRdamRequest is RdamRequest Setter
// 请求对象
func (r *AliyunCosmoGatewayInvokeAPIRequest) SetRdamRequest(_rdamRequest *RdamGenericRequest) error {
r._rdamRequest = _rdamRequest
r.Set("rdam_request", _rdamRequest)
return nil
}
// GetRdamRequest RdamRequest Getter
func (r AliyunCosmoGatewayInvokeAPIRequest) GetRdamRequest() *RdamGenericRequest {
return r._rdamRequest
}
var poolAliyunCosmoGatewayInvokeAPIRequest = sync.Pool{
New: func() any {
return NewAliyunCosmoGatewayInvokeRequest()
},
}
// GetAliyunCosmoGatewayInvokeRequest 从 sync.Pool 获取 AliyunCosmoGatewayInvokeAPIRequest
func GetAliyunCosmoGatewayInvokeAPIRequest() *AliyunCosmoGatewayInvokeAPIRequest {
return poolAliyunCosmoGatewayInvokeAPIRequest.Get().(*AliyunCosmoGatewayInvokeAPIRequest)
}
// ReleaseAliyunCosmoGatewayInvokeAPIRequest 将 AliyunCosmoGatewayInvokeAPIRequest 放入 sync.Pool
func ReleaseAliyunCosmoGatewayInvokeAPIRequest(v *AliyunCosmoGatewayInvokeAPIRequest) {
v.Reset()
poolAliyunCosmoGatewayInvokeAPIRequest.Put(v)
}