client.go 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. // This file is auto-generated, don't edit it. Thanks.
  2. package client
  3. import (
  4. "io"
  5. "github.com/alibabacloud-go/tea/tea"
  6. credential "github.com/aliyun/credentials-go/credentials"
  7. )
  8. type InterceptorContext struct {
  9. Request *InterceptorContextRequest `json:"request,omitempty" xml:"request,omitempty" require:"true" type:"Struct"`
  10. Configuration *InterceptorContextConfiguration `json:"configuration,omitempty" xml:"configuration,omitempty" require:"true" type:"Struct"`
  11. Response *InterceptorContextResponse `json:"response,omitempty" xml:"response,omitempty" require:"true" type:"Struct"`
  12. }
  13. func (s InterceptorContext) String() string {
  14. return tea.Prettify(s)
  15. }
  16. func (s InterceptorContext) GoString() string {
  17. return s.String()
  18. }
  19. func (s *InterceptorContext) SetRequest(v *InterceptorContextRequest) *InterceptorContext {
  20. s.Request = v
  21. return s
  22. }
  23. func (s *InterceptorContext) SetConfiguration(v *InterceptorContextConfiguration) *InterceptorContext {
  24. s.Configuration = v
  25. return s
  26. }
  27. func (s *InterceptorContext) SetResponse(v *InterceptorContextResponse) *InterceptorContext {
  28. s.Response = v
  29. return s
  30. }
  31. type InterceptorContextRequest struct {
  32. Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"`
  33. Query map[string]*string `json:"query,omitempty" xml:"query,omitempty"`
  34. Body interface{} `json:"body,omitempty" xml:"body,omitempty"`
  35. Stream io.Reader `json:"stream,omitempty" xml:"stream,omitempty"`
  36. HostMap map[string]*string `json:"hostMap,omitempty" xml:"hostMap,omitempty"`
  37. Pathname *string `json:"pathname,omitempty" xml:"pathname,omitempty" require:"true"`
  38. ProductId *string `json:"productId,omitempty" xml:"productId,omitempty" require:"true"`
  39. Action *string `json:"action,omitempty" xml:"action,omitempty" require:"true"`
  40. Version *string `json:"version,omitempty" xml:"version,omitempty" require:"true"`
  41. Protocol *string `json:"protocol,omitempty" xml:"protocol,omitempty" require:"true"`
  42. Method *string `json:"method,omitempty" xml:"method,omitempty" require:"true"`
  43. AuthType *string `json:"authType,omitempty" xml:"authType,omitempty" require:"true"`
  44. BodyType *string `json:"bodyType,omitempty" xml:"bodyType,omitempty" require:"true"`
  45. ReqBodyType *string `json:"reqBodyType,omitempty" xml:"reqBodyType,omitempty" require:"true"`
  46. Style *string `json:"style,omitempty" xml:"style,omitempty"`
  47. Credential credential.Credential `json:"credential,omitempty" xml:"credential,omitempty" require:"true"`
  48. SignatureVersion *string `json:"signatureVersion,omitempty" xml:"signatureVersion,omitempty"`
  49. SignatureAlgorithm *string `json:"signatureAlgorithm,omitempty" xml:"signatureAlgorithm,omitempty"`
  50. UserAgent *string `json:"userAgent,omitempty" xml:"userAgent,omitempty" require:"true"`
  51. }
  52. func (s InterceptorContextRequest) String() string {
  53. return tea.Prettify(s)
  54. }
  55. func (s InterceptorContextRequest) GoString() string {
  56. return s.String()
  57. }
  58. func (s *InterceptorContextRequest) SetHeaders(v map[string]*string) *InterceptorContextRequest {
  59. s.Headers = v
  60. return s
  61. }
  62. func (s *InterceptorContextRequest) SetQuery(v map[string]*string) *InterceptorContextRequest {
  63. s.Query = v
  64. return s
  65. }
  66. func (s *InterceptorContextRequest) SetBody(v interface{}) *InterceptorContextRequest {
  67. s.Body = v
  68. return s
  69. }
  70. func (s *InterceptorContextRequest) SetStream(v io.Reader) *InterceptorContextRequest {
  71. s.Stream = v
  72. return s
  73. }
  74. func (s *InterceptorContextRequest) SetHostMap(v map[string]*string) *InterceptorContextRequest {
  75. s.HostMap = v
  76. return s
  77. }
  78. func (s *InterceptorContextRequest) SetPathname(v string) *InterceptorContextRequest {
  79. s.Pathname = &v
  80. return s
  81. }
  82. func (s *InterceptorContextRequest) SetProductId(v string) *InterceptorContextRequest {
  83. s.ProductId = &v
  84. return s
  85. }
  86. func (s *InterceptorContextRequest) SetAction(v string) *InterceptorContextRequest {
  87. s.Action = &v
  88. return s
  89. }
  90. func (s *InterceptorContextRequest) SetVersion(v string) *InterceptorContextRequest {
  91. s.Version = &v
  92. return s
  93. }
  94. func (s *InterceptorContextRequest) SetProtocol(v string) *InterceptorContextRequest {
  95. s.Protocol = &v
  96. return s
  97. }
  98. func (s *InterceptorContextRequest) SetMethod(v string) *InterceptorContextRequest {
  99. s.Method = &v
  100. return s
  101. }
  102. func (s *InterceptorContextRequest) SetAuthType(v string) *InterceptorContextRequest {
  103. s.AuthType = &v
  104. return s
  105. }
  106. func (s *InterceptorContextRequest) SetBodyType(v string) *InterceptorContextRequest {
  107. s.BodyType = &v
  108. return s
  109. }
  110. func (s *InterceptorContextRequest) SetReqBodyType(v string) *InterceptorContextRequest {
  111. s.ReqBodyType = &v
  112. return s
  113. }
  114. func (s *InterceptorContextRequest) SetStyle(v string) *InterceptorContextRequest {
  115. s.Style = &v
  116. return s
  117. }
  118. func (s *InterceptorContextRequest) SetCredential(v credential.Credential) *InterceptorContextRequest {
  119. s.Credential = v
  120. return s
  121. }
  122. func (s *InterceptorContextRequest) SetSignatureVersion(v string) *InterceptorContextRequest {
  123. s.SignatureVersion = &v
  124. return s
  125. }
  126. func (s *InterceptorContextRequest) SetSignatureAlgorithm(v string) *InterceptorContextRequest {
  127. s.SignatureAlgorithm = &v
  128. return s
  129. }
  130. func (s *InterceptorContextRequest) SetUserAgent(v string) *InterceptorContextRequest {
  131. s.UserAgent = &v
  132. return s
  133. }
  134. type InterceptorContextConfiguration struct {
  135. RegionId *string `json:"regionId,omitempty" xml:"regionId,omitempty" require:"true"`
  136. Endpoint *string `json:"endpoint,omitempty" xml:"endpoint,omitempty"`
  137. EndpointRule *string `json:"endpointRule,omitempty" xml:"endpointRule,omitempty"`
  138. EndpointMap map[string]*string `json:"endpointMap,omitempty" xml:"endpointMap,omitempty"`
  139. EndpointType *string `json:"endpointType,omitempty" xml:"endpointType,omitempty"`
  140. Network *string `json:"network,omitempty" xml:"network,omitempty"`
  141. Suffix *string `json:"suffix,omitempty" xml:"suffix,omitempty"`
  142. }
  143. func (s InterceptorContextConfiguration) String() string {
  144. return tea.Prettify(s)
  145. }
  146. func (s InterceptorContextConfiguration) GoString() string {
  147. return s.String()
  148. }
  149. func (s *InterceptorContextConfiguration) SetRegionId(v string) *InterceptorContextConfiguration {
  150. s.RegionId = &v
  151. return s
  152. }
  153. func (s *InterceptorContextConfiguration) SetEndpoint(v string) *InterceptorContextConfiguration {
  154. s.Endpoint = &v
  155. return s
  156. }
  157. func (s *InterceptorContextConfiguration) SetEndpointRule(v string) *InterceptorContextConfiguration {
  158. s.EndpointRule = &v
  159. return s
  160. }
  161. func (s *InterceptorContextConfiguration) SetEndpointMap(v map[string]*string) *InterceptorContextConfiguration {
  162. s.EndpointMap = v
  163. return s
  164. }
  165. func (s *InterceptorContextConfiguration) SetEndpointType(v string) *InterceptorContextConfiguration {
  166. s.EndpointType = &v
  167. return s
  168. }
  169. func (s *InterceptorContextConfiguration) SetNetwork(v string) *InterceptorContextConfiguration {
  170. s.Network = &v
  171. return s
  172. }
  173. func (s *InterceptorContextConfiguration) SetSuffix(v string) *InterceptorContextConfiguration {
  174. s.Suffix = &v
  175. return s
  176. }
  177. type InterceptorContextResponse struct {
  178. StatusCode *int `json:"statusCode,omitempty" xml:"statusCode,omitempty"`
  179. Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"`
  180. Body io.Reader `json:"body,omitempty" xml:"body,omitempty"`
  181. DeserializedBody interface{} `json:"deserializedBody,omitempty" xml:"deserializedBody,omitempty"`
  182. }
  183. func (s InterceptorContextResponse) String() string {
  184. return tea.Prettify(s)
  185. }
  186. func (s InterceptorContextResponse) GoString() string {
  187. return s.String()
  188. }
  189. func (s *InterceptorContextResponse) SetStatusCode(v int) *InterceptorContextResponse {
  190. s.StatusCode = &v
  191. return s
  192. }
  193. func (s *InterceptorContextResponse) SetHeaders(v map[string]*string) *InterceptorContextResponse {
  194. s.Headers = v
  195. return s
  196. }
  197. func (s *InterceptorContextResponse) SetBody(v io.Reader) *InterceptorContextResponse {
  198. s.Body = v
  199. return s
  200. }
  201. func (s *InterceptorContextResponse) SetDeserializedBody(v interface{}) *InterceptorContextResponse {
  202. s.DeserializedBody = v
  203. return s
  204. }
  205. type AttributeMap struct {
  206. Attributes map[string]interface{} `json:"attributes,omitempty" xml:"attributes,omitempty" require:"true"`
  207. Key map[string]*string `json:"key,omitempty" xml:"key,omitempty" require:"true"`
  208. }
  209. func (s AttributeMap) String() string {
  210. return tea.Prettify(s)
  211. }
  212. func (s AttributeMap) GoString() string {
  213. return s.String()
  214. }
  215. func (s *AttributeMap) SetAttributes(v map[string]interface{}) *AttributeMap {
  216. s.Attributes = v
  217. return s
  218. }
  219. func (s *AttributeMap) SetKey(v map[string]*string) *AttributeMap {
  220. s.Key = v
  221. return s
  222. }
  223. type ClientInterface interface {
  224. ModifyConfiguration(context *InterceptorContext, attributeMap *AttributeMap) error
  225. ModifyRequest(context *InterceptorContext, attributeMap *AttributeMap) error
  226. ModifyResponse(context *InterceptorContext, attributeMap *AttributeMap) error
  227. }
  228. type Client struct {
  229. }
  230. func NewClient() (*Client, error) {
  231. client := new(Client)
  232. err := client.Init()
  233. return client, err
  234. }
  235. func (client *Client) Init() (_err error) {
  236. return nil
  237. }
  238. func (client *Client) ModifyConfiguration(context *InterceptorContext, attributeMap *AttributeMap) (_err error) {
  239. panic("No Support!")
  240. }
  241. func (client *Client) ModifyRequest(context *InterceptorContext, attributeMap *AttributeMap) (_err error) {
  242. panic("No Support!")
  243. }
  244. func (client *Client) ModifyResponse(context *InterceptorContext, attributeMap *AttributeMap) (_err error) {
  245. panic("No Support!")
  246. }