Skip to content

Commit

Permalink
suuport endpointOverride for OpenApiRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
yndu13 authored and peze committed Apr 11, 2022
1 parent 5543cd1 commit ac94f05
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,12 @@ func (s *Config) SetSignatureAlgorithm(v string) *Config {
}

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"`
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 (s OpenApiRequest) String() string {
Expand Down Expand Up @@ -238,6 +239,11 @@ func (s *OpenApiRequest) SetHostMap(v map[string]*string) *OpenApiRequest {
return s
}

func (s *OpenApiRequest) SetEndpointOverride(v string) *OpenApiRequest {
s.EndpointOverride = &v
return s
}

type Params struct {
Action *string `json:"action,omitempty" xml:"action,omitempty" require:"true"`
Version *string `json:"version,omitempty" xml:"version,omitempty" require:"true"`
Expand Down Expand Up @@ -1351,7 +1357,7 @@ func (client *Client) Execute(params *Params, request *OpenApiRequest, runtime *
}
configurationContext := &spi.InterceptorContextConfiguration{
RegionId: client.RegionId,
Endpoint: client.Endpoint,
Endpoint: util.DefaultString(request.EndpointOverride, client.Endpoint),
EndpointRule: client.EndpointRule,
EndpointMap: client.EndpointMap,
EndpointType: client.EndpointType,
Expand Down

0 comments on commit ac94f05

Please sign in to comment.