model.go raw
1 package models
2
3 import (
4 "io"
5
6 "github.com/alibabacloud-go/tea/dara"
7 credential "github.com/aliyun/credentials-go/credentials"
8 )
9
10 // Description:
11 //
12 // This is for OpenApi Util
13 type iGlobalParameters interface {
14 dara.Model
15 String() string
16 GoString() string
17 SetHeaders(v map[string]*string) *GlobalParameters
18 GetHeaders() map[string]*string
19 SetQueries(v map[string]*string) *GlobalParameters
20 GetQueries() map[string]*string
21 }
22
23 type GlobalParameters struct {
24 dara.Model
25 Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"`
26 Queries map[string]*string `json:"queries,omitempty" xml:"queries,omitempty"`
27 }
28
29 func (s GlobalParameters) String() string {
30 return dara.Prettify(s)
31 }
32
33 func (s GlobalParameters) GoString() string {
34 return s.String()
35 }
36
37 func (s *GlobalParameters) GetHeaders() map[string]*string {
38 return s.Headers
39 }
40
41 func (s *GlobalParameters) GetQueries() map[string]*string {
42 return s.Queries
43 }
44
45 func (s *GlobalParameters) SetHeaders(v map[string]*string) *GlobalParameters {
46 s.Headers = v
47 return s
48 }
49
50 func (s *GlobalParameters) SetQueries(v map[string]*string) *GlobalParameters {
51 s.Queries = v
52 return s
53 }
54
55 type iConfig interface {
56 dara.Model
57 String() string
58 GoString() string
59 SetAccessKeyId(v string) *Config
60 GetAccessKeyId() *string
61 SetAccessKeySecret(v string) *Config
62 GetAccessKeySecret() *string
63 SetSecurityToken(v string) *Config
64 GetSecurityToken() *string
65 SetBearerToken(v string) *Config
66 GetBearerToken() *string
67 SetProtocol(v string) *Config
68 GetProtocol() *string
69 SetMethod(v string) *Config
70 GetMethod() *string
71 SetRegionId(v string) *Config
72 GetRegionId() *string
73 SetReadTimeout(v int) *Config
74 GetReadTimeout() *int
75 SetIdleTimeout(v int) *Config
76 GetIdleTimeout() *int
77 SetConnectTimeout(v int) *Config
78 GetConnectTimeout() *int
79 SetHttpProxy(v string) *Config
80 GetHttpProxy() *string
81 SetHttpsProxy(v string) *Config
82 GetHttpsProxy() *string
83 SetCredential(v credential.Credential) *Config
84 GetCredential() credential.Credential
85 SetEndpoint(v string) *Config
86 GetEndpoint() *string
87 SetNoProxy(v string) *Config
88 GetNoProxy() *string
89 SetMaxIdleConns(v int) *Config
90 GetMaxIdleConns() *int
91 SetNetwork(v string) *Config
92 GetNetwork() *string
93 SetUserAgent(v string) *Config
94 GetUserAgent() *string
95 SetSuffix(v string) *Config
96 GetSuffix() *string
97 SetSocks5Proxy(v string) *Config
98 GetSocks5Proxy() *string
99 SetSocks5NetWork(v string) *Config
100 GetSocks5NetWork() *string
101 SetEndpointType(v string) *Config
102 GetEndpointType() *string
103 SetOpenPlatformEndpoint(v string) *Config
104 GetOpenPlatformEndpoint() *string
105 SetType(v string) *Config
106 GetType() *string
107 SetSignatureVersion(v string) *Config
108 GetSignatureVersion() *string
109 SetSignatureAlgorithm(v string) *Config
110 GetSignatureAlgorithm() *string
111 SetGlobalParameters(v *GlobalParameters) *Config
112 GetGlobalParameters() *GlobalParameters
113 SetKey(v string) *Config
114 GetKey() *string
115 SetCert(v string) *Config
116 GetCert() *string
117 SetCa(v string) *Config
118 GetCa() *string
119 SetDisableHttp2(v bool) *Config
120 GetDisableHttp2() *bool
121 SetRetryOptions(v *dara.RetryOptions) *Config
122 GetRetryOptions() *dara.RetryOptions
123 GetTlsMinVersion() *string
124 SetTlsMinVersion(v string) *Config
125 }
126
127 // Description:
128 //
129 // Model for initing client
130 type Config struct {
131 dara.Model
132 // accesskey id
133 AccessKeyId *string `json:"accessKeyId,omitempty" xml:"accessKeyId,omitempty"`
134 // accesskey secret
135 AccessKeySecret *string `json:"accessKeySecret,omitempty" xml:"accessKeySecret,omitempty"`
136 // security token
137 SecurityToken *string `json:"securityToken,omitempty" xml:"securityToken,omitempty"`
138 // bearer token
139 //
140 // example:
141 //
142 // the-bearer-token
143 BearerToken *string `json:"bearerToken,omitempty" xml:"bearerToken,omitempty"`
144 // http protocol
145 //
146 // example:
147 //
148 // http
149 Protocol *string `json:"protocol,omitempty" xml:"protocol,omitempty"`
150 // http method
151 //
152 // example:
153 //
154 // GET
155 Method *string `json:"method,omitempty" xml:"method,omitempty"`
156 // region id
157 //
158 // example:
159 //
160 // cn-hangzhou
161 RegionId *string `json:"regionId,omitempty" xml:"regionId,omitempty"`
162 // read timeout
163 //
164 // example:
165 //
166 // 10
167 ReadTimeout *int `json:"readTimeout,omitempty" xml:"readTimeout,omitempty"`
168 // connect timeout
169 //
170 // example:
171 //
172 // 10
173 ConnectTimeout *int `json:"connectTimeout,omitempty" xml:"connectTimeout,omitempty"`
174 // idle timeout
175 //
176 // example:
177 //
178 // 30
179 IdleTimeout *int `json:"idleTimeout,omitempty" xml:"idleTimeout,omitempty"`
180 // http proxy
181 //
182 // example:
183 //
184 // http://localhost
185 HttpProxy *string `json:"httpProxy,omitempty" xml:"httpProxy,omitempty"`
186 // https proxy
187 //
188 // example:
189 //
190 // https://localhost
191 HttpsProxy *string `json:"httpsProxy,omitempty" xml:"httpsProxy,omitempty"`
192 // credential
193 Credential credential.Credential `json:"credential,omitempty" xml:"credential,omitempty"`
194 // endpoint
195 //
196 // example:
197 //
198 // cs.aliyuncs.com
199 Endpoint *string `json:"endpoint,omitempty" xml:"endpoint,omitempty"`
200 // proxy white list
201 //
202 // example:
203 //
204 // http://localhost
205 NoProxy *string `json:"noProxy,omitempty" xml:"noProxy,omitempty"`
206 // max idle conns
207 //
208 // example:
209 //
210 // 3
211 MaxIdleConns *int `json:"maxIdleConns,omitempty" xml:"maxIdleConns,omitempty"`
212 // network for endpoint
213 //
214 // example:
215 //
216 // public
217 Network *string `json:"network,omitempty" xml:"network,omitempty"`
218 // user agent
219 //
220 // example:
221 //
222 // Alibabacloud/1
223 UserAgent *string `json:"userAgent,omitempty" xml:"userAgent,omitempty"`
224 // suffix for endpoint
225 //
226 // example:
227 //
228 // aliyun
229 Suffix *string `json:"suffix,omitempty" xml:"suffix,omitempty"`
230 // socks5 proxy
231 Socks5Proxy *string `json:"socks5Proxy,omitempty" xml:"socks5Proxy,omitempty"`
232 // socks5 network
233 //
234 // example:
235 //
236 // TCP
237 Socks5NetWork *string `json:"socks5NetWork,omitempty" xml:"socks5NetWork,omitempty"`
238 // endpoint type
239 //
240 // example:
241 //
242 // internal
243 EndpointType *string `json:"endpointType,omitempty" xml:"endpointType,omitempty"`
244 // OpenPlatform endpoint
245 //
246 // example:
247 //
248 // openplatform.aliyuncs.com
249 OpenPlatformEndpoint *string `json:"openPlatformEndpoint,omitempty" xml:"openPlatformEndpoint,omitempty"`
250 // Deprecated
251 //
252 // credential type
253 //
254 // example:
255 //
256 // access_key
257 Type *string `json:"type,omitempty" xml:"type,omitempty"`
258 // Signature Version
259 //
260 // example:
261 //
262 // v1
263 SignatureVersion *string `json:"signatureVersion,omitempty" xml:"signatureVersion,omitempty"`
264 // Signature Algorithm
265 //
266 // example:
267 //
268 // ACS3-HMAC-SHA256
269 SignatureAlgorithm *string `json:"signatureAlgorithm,omitempty" xml:"signatureAlgorithm,omitempty"`
270 // Global Parameters
271 GlobalParameters *GlobalParameters `json:"globalParameters,omitempty" xml:"globalParameters,omitempty"`
272 // privite key for client certificate
273 //
274 // example:
275 //
276 // MIIEvQ
277 Key *string `json:"key,omitempty" xml:"key,omitempty"`
278 // client certificate
279 //
280 // example:
281 //
282 // -----BEGIN CERTIFICATE-----
283 //
284 // xxx-----END CERTIFICATE-----
285 Cert *string `json:"cert,omitempty" xml:"cert,omitempty"`
286 // server certificate
287 //
288 // example:
289 //
290 // -----BEGIN CERTIFICATE-----
291 //
292 // xxx-----END CERTIFICATE-----
293 Ca *string `json:"ca,omitempty" xml:"ca,omitempty"`
294 // disable HTTP/2
295 //
296 // example:
297 //
298 // false
299 DisableHttp2 *bool `json:"disableHttp2,omitempty" xml:"disableHttp2,omitempty"`
300 // retry options
301 RetryOptions *dara.RetryOptions `json:"retryOptions,omitempty" xml:"retryOptions,omitempty"`
302 // http client
303 HttpClient dara.HttpClient `json:"httpClient,omitempty" xml:"httpClient,omitempty"`
304 TlsMinVersion *string `json:"tlsMinVersion,omitempty" xml:"tlsMinVersion,omitempty"`
305 }
306
307 func (s Config) String() string {
308 return dara.Prettify(s)
309 }
310
311 func (s Config) GoString() string {
312 return s.String()
313 }
314
315 func (s *Config) GetAccessKeyId() *string {
316 return s.AccessKeyId
317 }
318
319 func (s *Config) GetAccessKeySecret() *string {
320 return s.AccessKeySecret
321 }
322
323 func (s *Config) GetSecurityToken() *string {
324 return s.SecurityToken
325 }
326
327 func (s *Config) GetBearerToken() *string {
328 return s.BearerToken
329 }
330
331 func (s *Config) GetProtocol() *string {
332 return s.Protocol
333 }
334
335 func (s *Config) GetMethod() *string {
336 return s.Method
337 }
338
339 func (s *Config) GetRegionId() *string {
340 return s.RegionId
341 }
342
343 func (s *Config) GetReadTimeout() *int {
344 return s.ReadTimeout
345 }
346
347 func (s *Config) GetConnectTimeout() *int {
348 return s.ConnectTimeout
349 }
350
351 func (s *Config) GetIdleTimeout() *int {
352 return s.IdleTimeout
353 }
354
355 func (s *Config) GetHttpProxy() *string {
356 return s.HttpProxy
357 }
358
359 func (s *Config) GetHttpsProxy() *string {
360 return s.HttpsProxy
361 }
362
363 func (s *Config) GetCredential() credential.Credential {
364 return s.Credential
365 }
366
367 func (s *Config) GetEndpoint() *string {
368 return s.Endpoint
369 }
370
371 func (s *Config) GetNoProxy() *string {
372 return s.NoProxy
373 }
374
375 func (s *Config) GetMaxIdleConns() *int {
376 return s.MaxIdleConns
377 }
378
379 func (s *Config) GetNetwork() *string {
380 return s.Network
381 }
382
383 func (s *Config) GetUserAgent() *string {
384 return s.UserAgent
385 }
386
387 func (s *Config) GetSuffix() *string {
388 return s.Suffix
389 }
390
391 func (s *Config) GetSocks5Proxy() *string {
392 return s.Socks5Proxy
393 }
394
395 func (s *Config) GetSocks5NetWork() *string {
396 return s.Socks5NetWork
397 }
398
399 func (s *Config) GetEndpointType() *string {
400 return s.EndpointType
401 }
402
403 func (s *Config) GetOpenPlatformEndpoint() *string {
404 return s.OpenPlatformEndpoint
405 }
406
407 func (s *Config) GetType() *string {
408 return s.Type
409 }
410
411 func (s *Config) GetSignatureVersion() *string {
412 return s.SignatureVersion
413 }
414
415 func (s *Config) GetSignatureAlgorithm() *string {
416 return s.SignatureAlgorithm
417 }
418
419 func (s *Config) GetGlobalParameters() *GlobalParameters {
420 return s.GlobalParameters
421 }
422
423 func (s *Config) GetKey() *string {
424 return s.Key
425 }
426
427 func (s *Config) GetCert() *string {
428 return s.Cert
429 }
430
431 func (s *Config) GetCa() *string {
432 return s.Ca
433 }
434
435 func (s *Config) GetDisableHttp2() *bool {
436 return s.DisableHttp2
437 }
438
439 func (s *Config) GetRetryOptions() *dara.RetryOptions {
440 return s.RetryOptions
441 }
442
443 func (s *Config) GetHttpClient() dara.HttpClient {
444 return s.HttpClient
445 }
446
447 func (s *Config) SetAccessKeyId(v string) *Config {
448 s.AccessKeyId = &v
449 return s
450 }
451
452 func (s *Config) SetAccessKeySecret(v string) *Config {
453 s.AccessKeySecret = &v
454 return s
455 }
456
457 func (s *Config) SetSecurityToken(v string) *Config {
458 s.SecurityToken = &v
459 return s
460 }
461
462 func (s *Config) SetBearerToken(v string) *Config {
463 s.BearerToken = &v
464 return s
465 }
466
467 func (s *Config) SetProtocol(v string) *Config {
468 s.Protocol = &v
469 return s
470 }
471
472 func (s *Config) SetMethod(v string) *Config {
473 s.Method = &v
474 return s
475 }
476
477 func (s *Config) SetRegionId(v string) *Config {
478 s.RegionId = &v
479 return s
480 }
481
482 func (s *Config) SetReadTimeout(v int) *Config {
483 s.ReadTimeout = &v
484 return s
485 }
486
487 func (s *Config) SetConnectTimeout(v int) *Config {
488 s.ConnectTimeout = &v
489 return s
490 }
491
492 func (s *Config) SetIdleTimeout(v int) *Config {
493 s.IdleTimeout = &v
494 return s
495 }
496
497 func (s *Config) SetHttpProxy(v string) *Config {
498 s.HttpProxy = &v
499 return s
500 }
501
502 func (s *Config) SetHttpsProxy(v string) *Config {
503 s.HttpsProxy = &v
504 return s
505 }
506
507 func (s *Config) SetCredential(v credential.Credential) *Config {
508 s.Credential = v
509 return s
510 }
511
512 func (s *Config) SetEndpoint(v string) *Config {
513 s.Endpoint = &v
514 return s
515 }
516
517 func (s *Config) SetNoProxy(v string) *Config {
518 s.NoProxy = &v
519 return s
520 }
521
522 func (s *Config) SetMaxIdleConns(v int) *Config {
523 s.MaxIdleConns = &v
524 return s
525 }
526
527 func (s *Config) SetNetwork(v string) *Config {
528 s.Network = &v
529 return s
530 }
531
532 func (s *Config) SetUserAgent(v string) *Config {
533 s.UserAgent = &v
534 return s
535 }
536
537 func (s *Config) SetSuffix(v string) *Config {
538 s.Suffix = &v
539 return s
540 }
541
542 func (s *Config) SetSocks5Proxy(v string) *Config {
543 s.Socks5Proxy = &v
544 return s
545 }
546
547 func (s *Config) SetSocks5NetWork(v string) *Config {
548 s.Socks5NetWork = &v
549 return s
550 }
551
552 func (s *Config) SetEndpointType(v string) *Config {
553 s.EndpointType = &v
554 return s
555 }
556
557 func (s *Config) SetOpenPlatformEndpoint(v string) *Config {
558 s.OpenPlatformEndpoint = &v
559 return s
560 }
561
562 func (s *Config) SetType(v string) *Config {
563 s.Type = &v
564 return s
565 }
566
567 func (s *Config) SetSignatureVersion(v string) *Config {
568 s.SignatureVersion = &v
569 return s
570 }
571
572 func (s *Config) SetSignatureAlgorithm(v string) *Config {
573 s.SignatureAlgorithm = &v
574 return s
575 }
576
577 func (s *Config) SetGlobalParameters(v *GlobalParameters) *Config {
578 s.GlobalParameters = v
579 return s
580 }
581
582 func (s *Config) SetKey(v string) *Config {
583 s.Key = &v
584 return s
585 }
586
587 func (s *Config) SetCert(v string) *Config {
588 s.Cert = &v
589 return s
590 }
591
592 func (s *Config) SetCa(v string) *Config {
593 s.Ca = &v
594 return s
595 }
596
597 func (s *Config) SetDisableHttp2(v bool) *Config {
598 s.DisableHttp2 = &v
599 return s
600 }
601
602 func (s *Config) SetRetryOptions(v *dara.RetryOptions) *Config {
603 s.RetryOptions = v
604 return s
605 }
606
607 func (s *Config) SetHttpClient(v dara.HttpClient) *Config {
608 s.HttpClient = v
609 return s
610 }
611
612 type iParams interface {
613 dara.Model
614 String() string
615 GoString() string
616 SetAction(v string) *Params
617 GetAction() *string
618 SetVersion(v string) *Params
619 GetVersion() *string
620 SetProtocol(v string) *Params
621 GetProtocol() *string
622 SetPathname(v string) *Params
623 GetPathname() *string
624 SetMethod(v string) *Params
625 GetMethod() *string
626 SetAuthType(v string) *Params
627 GetAuthType() *string
628 SetBodyType(v string) *Params
629 GetBodyType() *string
630 SetReqBodyType(v string) *Params
631 GetReqBodyType() *string
632 SetStyle(v string) *Params
633 GetStyle() *string
634 }
635
636 type Params struct {
637 dara.Model
638 Action *string `json:"action,omitempty" xml:"action,omitempty" require:"true"`
639 Version *string `json:"version,omitempty" xml:"version,omitempty" require:"true"`
640 Protocol *string `json:"protocol,omitempty" xml:"protocol,omitempty" require:"true"`
641 Pathname *string `json:"pathname,omitempty" xml:"pathname,omitempty" require:"true"`
642 Method *string `json:"method,omitempty" xml:"method,omitempty" require:"true"`
643 AuthType *string `json:"authType,omitempty" xml:"authType,omitempty" require:"true"`
644 BodyType *string `json:"bodyType,omitempty" xml:"bodyType,omitempty" require:"true"`
645 ReqBodyType *string `json:"reqBodyType,omitempty" xml:"reqBodyType,omitempty" require:"true"`
646 Style *string `json:"style,omitempty" xml:"style,omitempty"`
647 }
648
649 func (s Params) String() string {
650 return dara.Prettify(s)
651 }
652
653 func (s Params) GoString() string {
654 return s.String()
655 }
656
657 func (s *Params) GetAction() *string {
658 return s.Action
659 }
660
661 func (s *Params) GetVersion() *string {
662 return s.Version
663 }
664
665 func (s *Params) GetProtocol() *string {
666 return s.Protocol
667 }
668
669 func (s *Params) GetPathname() *string {
670 return s.Pathname
671 }
672
673 func (s *Params) GetMethod() *string {
674 return s.Method
675 }
676
677 func (s *Params) GetAuthType() *string {
678 return s.AuthType
679 }
680
681 func (s *Params) GetBodyType() *string {
682 return s.BodyType
683 }
684
685 func (s *Params) GetReqBodyType() *string {
686 return s.ReqBodyType
687 }
688
689 func (s *Params) GetStyle() *string {
690 return s.Style
691 }
692
693 func (s *Params) SetAction(v string) *Params {
694 s.Action = &v
695 return s
696 }
697
698 func (s *Params) SetVersion(v string) *Params {
699 s.Version = &v
700 return s
701 }
702
703 func (s *Params) SetProtocol(v string) *Params {
704 s.Protocol = &v
705 return s
706 }
707
708 func (s *Params) SetPathname(v string) *Params {
709 s.Pathname = &v
710 return s
711 }
712
713 func (s *Params) SetMethod(v string) *Params {
714 s.Method = &v
715 return s
716 }
717
718 func (s *Params) SetAuthType(v string) *Params {
719 s.AuthType = &v
720 return s
721 }
722
723 func (s *Params) SetBodyType(v string) *Params {
724 s.BodyType = &v
725 return s
726 }
727
728 func (s *Params) SetReqBodyType(v string) *Params {
729 s.ReqBodyType = &v
730 return s
731 }
732
733 func (s *Params) SetStyle(v string) *Params {
734 s.Style = &v
735 return s
736 }
737
738 type iOpenApiRequest interface {
739 dara.Model
740 String() string
741 GoString() string
742 SetHeaders(v map[string]*string) *OpenApiRequest
743 GetHeaders() map[string]*string
744 SetQuery(v map[string]*string) *OpenApiRequest
745 GetQuery() map[string]*string
746 SetBody(v interface{}) *OpenApiRequest
747 GetBody() interface{}
748 SetStream(v io.Reader) *OpenApiRequest
749 GetStream() io.Reader
750 SetHostMap(v map[string]*string) *OpenApiRequest
751 GetHostMap() map[string]*string
752 SetEndpointOverride(v string) *OpenApiRequest
753 GetEndpointOverride() *string
754 }
755
756 type OpenApiRequest struct {
757 dara.Model
758 Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"`
759 Query map[string]*string `json:"query,omitempty" xml:"query,omitempty"`
760 Body interface{} `json:"body,omitempty" xml:"body,omitempty"`
761 Stream io.Reader `json:"stream,omitempty" xml:"stream,omitempty"`
762 HostMap map[string]*string `json:"hostMap,omitempty" xml:"hostMap,omitempty"`
763 EndpointOverride *string `json:"endpointOverride,omitempty" xml:"endpointOverride,omitempty"`
764 }
765
766 func (s OpenApiRequest) String() string {
767 return dara.Prettify(s)
768 }
769
770 func (s OpenApiRequest) GoString() string {
771 return s.String()
772 }
773
774 func (s *OpenApiRequest) GetHeaders() map[string]*string {
775 return s.Headers
776 }
777
778 func (s *OpenApiRequest) GetQuery() map[string]*string {
779 return s.Query
780 }
781
782 func (s *OpenApiRequest) GetBody() interface{} {
783 return s.Body
784 }
785
786 func (s *OpenApiRequest) GetStream() io.Reader {
787 return s.Stream
788 }
789
790 func (s *OpenApiRequest) GetHostMap() map[string]*string {
791 return s.HostMap
792 }
793
794 func (s *OpenApiRequest) GetEndpointOverride() *string {
795 return s.EndpointOverride
796 }
797
798 func (s *OpenApiRequest) SetHeaders(v map[string]*string) *OpenApiRequest {
799 s.Headers = v
800 return s
801 }
802
803 func (s *OpenApiRequest) SetQuery(v map[string]*string) *OpenApiRequest {
804 s.Query = v
805 return s
806 }
807
808 func (s *OpenApiRequest) SetBody(v interface{}) *OpenApiRequest {
809 s.Body = v
810 return s
811 }
812
813 func (s *OpenApiRequest) SetStream(v io.Reader) *OpenApiRequest {
814 s.Stream = v
815 return s
816 }
817
818 func (s *OpenApiRequest) SetHostMap(v map[string]*string) *OpenApiRequest {
819 s.HostMap = v
820 return s
821 }
822
823 func (s *OpenApiRequest) SetEndpointOverride(v string) *OpenApiRequest {
824 s.EndpointOverride = &v
825 return s
826 }
827