client.go raw

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