vendor: github.com/aws/aws-sdk-go-v2/config v1.26.6

vendor github.com/aws/aws-sdk-go-v2/config v1.26.6 and related dependencies.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2024-02-05 18:08:03 +01:00
parent 089982153f
commit 43ed470208
190 changed files with 12340 additions and 13837 deletions

View File

@ -239,6 +239,244 @@ func awsRestjson1_deserializeOpDocumentCreateTokenOutput(v **CreateTokenOutput,
return nil
}
type awsRestjson1_deserializeOpCreateTokenWithIAM struct {
}
func (*awsRestjson1_deserializeOpCreateTokenWithIAM) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateTokenWithIAM) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCreateTokenWithIAM(response, &metadata)
}
output := &CreateTokenWithIAMOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentCreateTokenWithIAMOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateTokenWithIAM(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationPendingException", errorCode):
return awsRestjson1_deserializeErrorAuthorizationPendingException(response, errorBody)
case strings.EqualFold("ExpiredTokenException", errorCode):
return awsRestjson1_deserializeErrorExpiredTokenException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidClientException", errorCode):
return awsRestjson1_deserializeErrorInvalidClientException(response, errorBody)
case strings.EqualFold("InvalidGrantException", errorCode):
return awsRestjson1_deserializeErrorInvalidGrantException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("InvalidRequestRegionException", errorCode):
return awsRestjson1_deserializeErrorInvalidRequestRegionException(response, errorBody)
case strings.EqualFold("InvalidScopeException", errorCode):
return awsRestjson1_deserializeErrorInvalidScopeException(response, errorBody)
case strings.EqualFold("SlowDownException", errorCode):
return awsRestjson1_deserializeErrorSlowDownException(response, errorBody)
case strings.EqualFold("UnauthorizedClientException", errorCode):
return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody)
case strings.EqualFold("UnsupportedGrantTypeException", errorCode):
return awsRestjson1_deserializeErrorUnsupportedGrantTypeException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateTokenWithIAMOutput(v **CreateTokenWithIAMOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateTokenWithIAMOutput
if *v == nil {
sv = &CreateTokenWithIAMOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "accessToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AccessToken to be of type string, got %T instead", value)
}
sv.AccessToken = ptr.String(jtv)
}
case "expiresIn":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ExpirationInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ExpiresIn = int32(i64)
}
case "idToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IdToken to be of type string, got %T instead", value)
}
sv.IdToken = ptr.String(jtv)
}
case "issuedTokenType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TokenTypeURI to be of type string, got %T instead", value)
}
sv.IssuedTokenType = ptr.String(jtv)
}
case "refreshToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RefreshToken to be of type string, got %T instead", value)
}
sv.RefreshToken = ptr.String(jtv)
}
case "scope":
if err := awsRestjson1_deserializeDocumentScopes(&sv.Scope, value); err != nil {
return err
}
case "tokenType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TokenType to be of type string, got %T instead", value)
}
sv.TokenType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpRegisterClient struct {
}
@ -956,6 +1194,42 @@ func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.R
return output
}
func awsRestjson1_deserializeErrorInvalidRequestRegionException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InvalidRequestRegionException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentInvalidRequestRegionException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorInvalidScopeException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InvalidScopeException{}
var buff [1024]byte
@ -1492,6 +1766,73 @@ func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRe
return nil
}
func awsRestjson1_deserializeDocumentInvalidRequestRegionException(v **types.InvalidRequestRegionException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InvalidRequestRegionException
if *v == nil {
sv = &types.InvalidRequestRegionException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "endpoint":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Location to be of type string, got %T instead", value)
}
sv.Endpoint = ptr.String(jtv)
}
case "error":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Error to be of type string, got %T instead", value)
}
sv.Error_ = ptr.String(jtv)
}
case "error_description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value)
}
sv.Error_description = ptr.String(jtv)
}
case "region":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Region to be of type string, got %T instead", value)
}
sv.Region = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInvalidScopeException(v **types.InvalidScopeException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
@ -1541,6 +1882,42 @@ func awsRestjson1_deserializeDocumentInvalidScopeException(v **types.InvalidScop
return nil
}
func awsRestjson1_deserializeDocumentScopes(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Scope to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentSlowDownException(v **types.SlowDownException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)